mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-07 20:42:09 -05:00
dll: fuse: optimize symlinks aways when readlink returns -ENOSYS
This commit is contained in:
parent
7aadf259d9
commit
1123e7b0ef
@ -376,6 +376,15 @@ static NTSTATUS fsp_fuse_svcstart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
|||||||
&f->VolumeParams.VolumeCreationTime);
|
&f->VolumeParams.VolumeCreationTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (0 != f->ops.readlink)
|
||||||
|
{
|
||||||
|
char buf[FSP_FSCTL_TRANSACT_PATH_SIZEMAX / sizeof(WCHAR)];
|
||||||
|
int err;
|
||||||
|
|
||||||
|
/* this should always fail with ENOSYS or EINVAL */
|
||||||
|
err = f->ops.readlink("/", buf, sizeof buf);
|
||||||
|
f->has_symlinks = -ENOSYS != err;
|
||||||
|
}
|
||||||
|
|
||||||
/* the FSD does not currently limit these VolumeParams fields; do so here! */
|
/* the FSD does not currently limit these VolumeParams fields; do so here! */
|
||||||
if (f->VolumeParams.SectorSize < FSP_FUSE_SECTORSIZE_MIN ||
|
if (f->VolumeParams.SectorSize < FSP_FUSE_SECTORSIZE_MIN ||
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define FSP_FUSE_CONTEXT_FROM_HDR(h) \
|
#define FSP_FUSE_CONTEXT_FROM_HDR(h) \
|
||||||
(struct fuse_context *)((PUINT8)(h) + sizeof(struct fsp_fuse_context_header))
|
(struct fuse_context *)((PUINT8)(h) + sizeof(struct fsp_fuse_context_header))
|
||||||
|
|
||||||
#define FSP_FUSE_HAS_SYMLINKS(f) (0 != (f)->ops.readlink)
|
#define FSP_FUSE_HAS_SYMLINKS(f) ((f)->has_symlinks)
|
||||||
|
|
||||||
struct fuse
|
struct fuse
|
||||||
{
|
{
|
||||||
@ -44,6 +44,7 @@ struct fuse
|
|||||||
void *data;
|
void *data;
|
||||||
unsigned conn_want;
|
unsigned conn_want;
|
||||||
BOOLEAN fsinit;
|
BOOLEAN fsinit;
|
||||||
|
BOOLEAN has_symlinks;
|
||||||
UINT32 DebugLog;
|
UINT32 DebugLog;
|
||||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY OpGuardStrategy;
|
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY OpGuardStrategy;
|
||||||
FSP_FSCTL_VOLUME_PARAMS VolumeParams;
|
FSP_FSCTL_VOLUME_PARAMS VolumeParams;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user