aboutsummaryrefslogtreecommitdiff
path: root/lib/helper.c
diff options
context:
space:
mode:
authorGravatar Joseph Dodge <joseph.dodge@veritas.com>2017-08-24 14:37:10 +0200
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-08-24 15:17:01 +0200
commitf12d9686d4d673e59b8f561c49996820763220b1 (patch)
treea06f9f3941f2abe727eb06f5ff1ec70972498208 /lib/helper.c
parentfc83143867a37e34a51ce5a6d763b46715abf02d (diff)
Add idle_threads mount option.
Diffstat (limited to 'lib/helper.c')
-rw-r--r--lib/helper.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/helper.c b/lib/helper.c
index 564a433..cb7aebc 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -48,6 +48,7 @@ static const struct fuse_opt fuse_helper_opts[] = {
FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP),
#endif
FUSE_HELPER_OPT("clone_fd", clone_fd),
+ FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads),
FUSE_OPT_END
};
@@ -132,7 +133,9 @@ void fuse_cmdline_help(void)
" -f foreground operation\n"
" -s disable multi-threaded operation\n"
" -o clone_fd use separate fuse device fd for each thread\n"
- " (may improve performance)\n");
+ " (may improve performance)\n"
+ " -o max_idle_threads the maximum number of idle worker threads\n"
+ " allowed (default: 10)\n");
}
static int fuse_helper_opt_proc(void *data, const char *arg, int key,
@@ -195,6 +198,9 @@ int fuse_parse_cmdline(struct fuse_args *args,
struct fuse_cmdline_opts *opts)
{
memset(opts, 0, sizeof(struct fuse_cmdline_opts));
+
+ opts->max_idle_threads = 10;
+
if (fuse_opt_parse(args, opts, fuse_helper_opts,
fuse_helper_opt_proc) == -1)
return -1;
@@ -326,8 +332,12 @@ int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
if (opts.singlethread)
res = fuse_loop(fuse);
- else
- res = fuse_loop_mt(fuse, opts.clone_fd);
+ else {
+ struct fuse_loop_config loop_config;
+ loop_config.clone_fd = opts.clone_fd;
+ loop_config.max_idle_threads = opts.max_idle_threads;
+ res = fuse_loop_mt(fuse, &loop_config);
+ }
if (res)
res = 1;