dll: fuse: add ThreadCount option

This commit is contained in:
Bill Zissimopoulos 2018-04-23 15:35:30 -07:00
parent 498ab91123
commit 382599e38f
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3
2 changed files with 6 additions and 1 deletions

View File

@ -43,6 +43,7 @@ struct fsp_fuse_core_opt_data
set_DirInfoTimeout, set_DirInfoTimeout,
set_VolumeInfoTimeout, set_VolumeInfoTimeout,
set_KeepFileCache; set_KeepFileCache;
unsigned ThreadCount;
FSP_FSCTL_VOLUME_PARAMS VolumeParams; FSP_FSCTL_VOLUME_PARAMS VolumeParams;
UINT16 VolumeLabelLength; UINT16 VolumeLabelLength;
WCHAR VolumeLabel[sizeof ((FSP_FSCTL_VOLUME_INFO *)0)->VolumeLabel / sizeof(WCHAR)]; WCHAR VolumeLabel[sizeof ((FSP_FSCTL_VOLUME_INFO *)0)->VolumeLabel / sizeof(WCHAR)];
@ -107,6 +108,7 @@ static struct fuse_opt fsp_fuse_core_opts[] =
FSP_FUSE_CORE_OPT("VolumeInfoTimeout=", set_VolumeInfoTimeout, 1), FSP_FUSE_CORE_OPT("VolumeInfoTimeout=", set_VolumeInfoTimeout, 1),
FSP_FUSE_CORE_OPT("VolumeInfoTimeout=%d", VolumeParams.VolumeInfoTimeout, 0), FSP_FUSE_CORE_OPT("VolumeInfoTimeout=%d", VolumeParams.VolumeInfoTimeout, 0),
FSP_FUSE_CORE_OPT("KeepFileCache=", set_KeepFileCache, 1), FSP_FUSE_CORE_OPT("KeepFileCache=", set_KeepFileCache, 1),
FSP_FUSE_CORE_OPT("ThreadCount=%u", ThreadCount, 0),
FUSE_OPT_KEY("UNC=", 'U'), FUSE_OPT_KEY("UNC=", 'U'),
FUSE_OPT_KEY("--UNC=", 'U'), FUSE_OPT_KEY("--UNC=", 'U'),
FUSE_OPT_KEY("VolumePrefix=", 'U'), FUSE_OPT_KEY("VolumePrefix=", 'U'),
@ -424,7 +426,7 @@ static NTSTATUS fsp_fuse_svcstart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
} }
} }
Result = FspFileSystemStartDispatcher(f->FileSystem, 0); Result = FspFileSystemStartDispatcher(f->FileSystem, f->ThreadCount);
if (!NT_SUCCESS(Result)) if (!NT_SUCCESS(Result))
{ {
FspServiceLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
@ -499,6 +501,7 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key,
" -o DirInfoTimeout=N directory info timeout (millis)\n" " -o DirInfoTimeout=N directory info timeout (millis)\n"
" -o VolumeInfoTimeout=N volume info timeout (millis)\n" " -o VolumeInfoTimeout=N volume info timeout (millis)\n"
" -o KeepFileCache do not discard cache when files are closed\n" " -o KeepFileCache do not discard cache when files are closed\n"
" -o ThreadCount number of file system dispatcher threads\n"
); );
opt_data->help = 1; opt_data->help = 1;
return 1; return 1;
@ -651,6 +654,7 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env,
f->set_uid = opt_data.set_uid; f->uid = opt_data.uid; f->set_uid = opt_data.set_uid; f->uid = opt_data.uid;
f->set_gid = opt_data.set_gid; f->gid = opt_data.gid; f->set_gid = opt_data.set_gid; f->gid = opt_data.gid;
f->rellinks = opt_data.rellinks; f->rellinks = opt_data.rellinks;
f->ThreadCount = opt_data.ThreadCount;
memcpy(&f->ops, ops, opsize); memcpy(&f->ops, ops, opsize);
f->data = data; f->data = data;
f->DebugLog = opt_data.debug ? -1 : 0; f->DebugLog = opt_data.debug ? -1 : 0;

View File

@ -39,6 +39,7 @@ struct fuse
int set_uid, uid; int set_uid, uid;
int set_gid, gid; int set_gid, gid;
int rellinks; int rellinks;
unsigned ThreadCount;
struct fuse_operations ops; struct fuse_operations ops;
void *data; void *data;
unsigned conn_want; unsigned conn_want;