From 9e022d4b0e86eabc7121b6190e7709189c64122b Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Sat, 9 Jul 2022 08:48:40 +0800 Subject: [PATCH] fuse_ll: fix compile error when libfuse version is larger than 3.0 Fixes: https://tracker.ceph.com/issues/56517 Signed-off-by: Xiubo Li (cherry picked from commit 2f3f9d36afc891d55b1e4f13ca212c5aa040ee31) --- src/client/fuse_ll.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index b725a20e1af7f..2f4cd28b34079 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -170,13 +170,13 @@ public: int fd_on_success; Client *client; - struct fuse_session *se; + struct fuse_session *se = nullptr; #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0) struct fuse_cmdline_opts opts; struct fuse_conn_info_opts *conn_opts; #else - struct fuse_chan *ch; - char *mountpoint; + struct fuse_chan *ch = nullptr; + char *mountpoint = nullptr; #endif ceph::mutex stag_lock = ceph::make_mutex("fuse_ll.cc stag_lock"); @@ -1370,12 +1370,7 @@ const static struct fuse_lowlevel_ops fuse_ll_oper = { CephFuse::Handle::Handle(Client *c, int fd) : fd_on_success(fd), - client(c), - se(NULL), -#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 0) - ch(NULL), - mountpoint(NULL) -#endif + client(c) { memset(&args, 0, sizeof(args)); #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0) -- 2.39.5