client/fuse: add support for 3.12 API of libfuse

Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
This commit is contained in:
Zhansong Gao 2022-12-07 01:04:17 +08:00
parent 70425c75df
commit 2f224e2993
2 changed files with 16 additions and 2 deletions

View File

@ -1603,7 +1603,21 @@ int CephFuse::Handle::loop()
auto fuse_multithreaded = client->cct->_conf.get_val<bool>(
"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,

View File

@ -20,7 +20,7 @@
* fuse.h is included.
*/
#ifndef FUSE_USE_VERSION
#define FUSE_USE_VERSION 35
#define FUSE_USE_VERSION 312
#endif
#include <fuse.h>