diff options
author | Bernd Schubert <bschubert@ddn.com> | 2022-03-22 19:55:36 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2023-01-13 10:21:42 +0000 |
commit | 856c683c361cb1f3a176df331cbbac76c34402e7 (patch) | |
tree | 8a1b461ff5f3eded9d0823b220e03290dc71b049 /lib/fuse_loop_mt.c | |
parent | aad5c3a44d4386b2128b956446b2c6295a4c28ad (diff) | |
download | libfuse-856c683c361cb1f3a176df331cbbac76c34402e7.tar.gz |
passthrough_hp: Add options for clone_fd, max_threads, daemonize
This is useful for benchmarking.
Note: This changes behavior - passthrough_hp runs in background by default
now.
Diffstat (limited to 'lib/fuse_loop_mt.c')
-rw-r--r-- | lib/fuse_loop_mt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 72c74a8..b8b2fdd 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -35,6 +35,9 @@ #define FUSE_LOOP_MT_DEF_IDLE_THREADS -1 /* thread destruction is disabled * by default */ +/* an arbitrary large value that cannot be valid */ +#define FUSE_LOOP_MT_MAX_THREADS (100U * 1000) + struct fuse_worker { struct fuse_worker *prev; struct fuse_worker *next; @@ -460,6 +463,12 @@ void fuse_loop_cfg_convert(struct fuse_loop_config *config, void fuse_loop_cfg_set_idle_threads(struct fuse_loop_config *config, unsigned int value) { + if (value > FUSE_LOOP_MT_MAX_THREADS) { + fuse_log(FUSE_LOG_ERR, + "Ignoring invalid max threads value " + "%u > max (%u).\n", value, FUSE_LOOP_MT_MAX_THREADS); + return; + } config->max_idle_threads = value; } |