From 2f224e29930767fd6eec72e2565821aa1bb2d68c Mon Sep 17 00:00:00 2001 From: Zhansong Gao Date: Wed, 7 Dec 2022 01:04:17 +0800 Subject: [PATCH] client/fuse: add support for 3.12 API of libfuse Signed-off-by: Zhansong Gao --- src/client/fuse_ll.cc | 16 +++++++++++++++- src/include/ceph_fuse.h | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 517eb79ce8c..7f92dd668ba 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -1603,7 +1603,21 @@ int CephFuse::Handle::loop() auto fuse_multithreaded = client->cct->_conf.get_val( "fuse_multithreaded"); if (fuse_multithreaded) { -#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 1) +#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 12) + { + struct fuse_loop_config *conf = fuse_loop_cfg_create(); + ceph_assert(conf != nullptr); + + fuse_loop_cfg_set_clone_fd(conf, opts.clone_fd); + fuse_loop_cfg_set_idle_threads(conf, opts.max_idle_threads); + fuse_loop_cfg_set_max_threads(conf, opts.max_threads); + + int r = fuse_session_loop_mt(se, conf); + + fuse_loop_cfg_destroy(conf); + return r; + } +#elif FUSE_VERSION >= FUSE_MAKE_VERSION(3, 1) { struct fuse_loop_config conf = { clone_fd: opts.clone_fd, diff --git a/src/include/ceph_fuse.h b/src/include/ceph_fuse.h index c95fd19408c..cfa8097bb4c 100644 --- a/src/include/ceph_fuse.h +++ b/src/include/ceph_fuse.h @@ -20,7 +20,7 @@ * fuse.h is included. */ #ifndef FUSE_USE_VERSION -#define FUSE_USE_VERSION 35 +#define FUSE_USE_VERSION 312 #endif #include -- 2.47.3