diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-04-15 18:08:54 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-28 19:57:39 +0200 |
commit | 71b6fb723aacd9c216c68db3cc1f4d87291cf408 (patch) | |
tree | 6051743e24da70de3202a22224466b5f469f7c3e | |
parent | 3824fabf8aaa6210876ac0519f451f4885c7ebbc (diff) | |
download | libfuse-71b6fb723aacd9c216c68db3cc1f4d87291cf408.tar.gz |
fuse: Add io-uring options
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
-rw-r--r-- | lib/fuse_lowlevel.c | 10 | ||||
-rw-r--r-- | lib/fuse_uring_i.h | 4 | ||||
-rw-r--r-- | lib/helper.c | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 03aeca7..ad36414 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -3545,6 +3545,8 @@ static const struct fuse_opt fuse_ll_opts[] = { LL_OPTION("-d", debug, 1), LL_OPTION("--debug", debug, 1), LL_OPTION("allow_root", deny_others, 1), + LL_OPTION("io_uring", uring.enable, 1), + LL_OPTION("io_uring_q_depth=%u", uring.q_depth, -1), FUSE_OPT_END }; @@ -3562,7 +3564,11 @@ void fuse_lowlevel_help(void) printf( " -o allow_other allow access by all users\n" " -o allow_root allow access by root\n" -" -o auto_unmount auto unmount on process termination\n"); +" -o auto_unmount auto unmount on process termination\n" +" -o auto_unmount auto unmount on process termination\n" +" -o io_uring enable io-uring\n" +" -o io_uring_q_depth=<n> io-uring queue depth\n" +); } void fuse_session_destroy(struct fuse_session *se) @@ -3892,6 +3898,8 @@ 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; /* Parse options */ if(fuse_opt_parse(args, se, fuse_ll_opts, NULL) == -1) diff --git a/lib/fuse_uring_i.h b/lib/fuse_uring_i.h index 40cda5b..a652417 100644 --- a/lib/fuse_uring_i.h +++ b/lib/fuse_uring_i.h @@ -16,6 +16,10 @@ #include "util.h" #endif +/* io-uring defaults */ +#define SESSION_DEF_URING_ENABLE (0) +#define SESSION_DEF_URING_Q_DEPTH (8) + void fuse_session_process_uring_cqe(struct fuse_session *se, struct fuse_req *req, struct fuse_in_header *in, void *in_header, diff --git a/lib/helper.c b/lib/helper.c index 0b0dad2..5811c53 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -139,7 +139,11 @@ void fuse_cmdline_help(void) " -o max_idle_threads the maximum number of idle worker threads\n" " allowed (default: -1)\n" " -o max_threads the maximum number of worker threads\n" - " allowed (default: 10)\n"); + " allowed (default: 10)\n" + /* fuse_ll_opts in fuse_lowlevel.c, FIXME, call into that file */ + " -o io_uring enable io-uring\n" + " -o io_uring_q_depth=<n> io-uring queue depth\n" +); } static int fuse_helper_opt_proc(void *data, const char *arg, int key, |