From: Zhansong Gao Date: Tue, 6 Dec 2022 17:04:17 +0000 (+0800) Subject: client/fuse: add support for 3.12 API of libfuse X-Git-Tag: v18.1.0~596^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f224e29930767fd6eec72e2565821aa1bb2d68c;p=ceph.git client/fuse: add support for 3.12 API of libfuse Signed-off-by: Zhansong Gao --- diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 517eb79ce8c2..7f92dd668ba3 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 c95fd19408c2..cfa8097bb4c5 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