From 3421cab7773268e0afb4b300775b4d60f2b7acf5 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Thu, 24 Apr 2025 19:38:21 +0200 Subject: env variables to override default io-uring enable and q-depth We want to especially test with and without io-uring being enabled. Ideally without modifying all tests - that is what the env variable can be used for. Signed-off-by: Bernd Schubert --- lib/fuse_lowlevel.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index c7cbebd..8c9cb90 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -3903,8 +3903,17 @@ fuse_session_new_versioned(struct fuse_args *args, se->conn.max_write = FUSE_DEFAULT_MAX_PAGES_LIMIT * getpagesize(); se->bufsize = se->conn.max_write + FUSE_BUFFER_HEADER_SIZE; se->conn.max_readahead = UINT_MAX; - se->uring.enable = SESSION_DEF_URING_ENABLE; - se->uring.q_depth = SESSION_DEF_URING_Q_DEPTH; + + /* + * Allow overriding with env, mostly to avoid the need to modify + * all tests. I.e. to test with and without io-uring being enabled. + */ + se->uring.enable = getenv("FUSE_URING_ENABLE") ? + atoi(getenv("FUSE_URING_ENABLE")) : + SESSION_DEF_URING_ENABLE; + se->uring.q_depth = getenv("FUSE_URING_QUEUE_DEPTH") ? + atoi(getenv("FUSE_URING_QUEUE_DEPTH")) : + SESSION_DEF_URING_Q_DEPTH; /* Parse options */ if(fuse_opt_parse(args, se, fuse_ll_opts, NULL) == -1) -- cgit v1.2.3