From 856c683c361cb1f3a176df331cbbac76c34402e7 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Tue, 22 Mar 2022 19:55:36 +0100 Subject: 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. --- lib/fuse_loop_mt.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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; } -- cgit v1.2.3