]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fuse: update to newer FUSE_USE_VERSION 35368/head
authorJeff Layton <jlayton@redhat.com>
Wed, 3 Jun 2020 15:29:07 +0000 (11:29 -0400)
committerJeff Layton <jlayton@redhat.com>
Wed, 3 Jun 2020 18:03:31 +0000 (14:03 -0400)
The build was failing for me against fuse-devel v3.9.1. The prototype
for fuse_ll_ioctl was wrong, as it was expecting the old-style one with
signed int args.

In newer libfuse versions, the prototype varies based on
FUSE_USE_VERSION. Update to a newer FUSE_USE_VERSION value to ensure
that we use the newer ioctl prototype. This also means that we need to
handle a new prototype for fuse_session_loop_mt as well.

While we're in here, move the definition of FUSE_USE_VERSION to
ceph_fuse.h so we have the definition in one place. This does mean we
need to reorganize the includes in a few places.

Fixes: https://tracker.ceph.com/issues/45866
Signed-off-by: Jeff Layton <jlayton@redhat.com>
fusetrace/fusetrace_ll.cc
src/ceph_fuse.cc
src/client/fuse_ll.cc
src/client/fuse_ll.h
src/include/ceph_fuse.h
src/os/FuseStore.cc
src/rbd_fuse/rbd-fuse.cc

index b411a83fe20381b04ba5f012d01e73a02064f705..f10c29fd22e9ef1806e47541deae9319b6753f92 100644 (file)
@@ -11,8 +11,6 @@
     gcc -Wall `pkg-config fuse --cflags --libs` -lulockmgr fusexmp_fh.c -o fusexmp_fh
 */
 
-#define FUSE_USE_VERSION 30
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
index 02aed32ac6994068ef30da388b2c8ed98198f052..26bdfbbe9fc7d080ef38d51a42394162db2218c4 100644 (file)
@@ -42,9 +42,8 @@
 #include <sys/types.h>
 #include <fcntl.h>
 
-#include <fuse.h>
-#include <fuse_lowlevel.h>
 #include "include/ceph_fuse.h"
+#include <fuse_lowlevel.h>
 
 #define dout_context g_ceph_context
 
index 600cfbdd255144fa4d36b971e78eaffca7218bf3..3b2118bdcdde32a72e1c129f506e8f5247af6b1e 100644 (file)
@@ -37,7 +37,6 @@
 #include "include/ceph_fuse.h"
 
 #include "fuse_ll.h"
-#include <fuse.h>
 #include <fuse_lowlevel.h>
 
 #define dout_context g_ceph_context
@@ -1262,7 +1261,14 @@ 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, 0)
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 1)
+    {
+      struct fuse_loop_config conf = { 0 };
+
+      conf.clone_fd = opts.clone_fd;
+      return fuse_session_loop_mt(se, &conf);
+    }
+#elif FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
     return fuse_session_loop_mt(se, opts.clone_fd);
 #else
     return fuse_session_loop_mt(se);
index 3d7b891ddb44a1a48de71585d0450219954c315f..85e587baf46b55acac1de0cf5c06995ebc4e8f50 100644 (file)
@@ -12,8 +12,6 @@
  * 
  */
 
-#define FUSE_USE_VERSION 30
-
 class CephFuse {
 public:
   CephFuse(Client *c, int fd);
index ae504f6715de476f56b8166f0f243ade7132b3e1..c95fd19408c257b84d04978455a16ac7fbe3d973 100644 (file)
 #ifndef CEPH_FUSE_H
 #define CEPH_FUSE_H
 
-#define FUSE_USE_VERSION 30
+/*
+ * The API version that we want to use, regardless of what the
+ * library version is. Note that this must be defined before
+ * fuse.h is included.
+ */
+#ifndef FUSE_USE_VERSION
+#define FUSE_USE_VERSION       35
+#endif
+
 #include <fuse.h>
 #include "acconfig.h"
 
index 35755f737f17d2f7d3ba1dca6d88e40de7ab45fb..8845d9f08063e64f1586ea45819f63932d514b36 100644 (file)
@@ -2,15 +2,13 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "include/compat.h"
+#include "include/ceph_fuse.h"
 #include "FuseStore.h"
 #include "os/ObjectStore.h"
 #include "include/stringify.h"
 #include "common/errno.h"
 
-#define FUSE_USE_VERSION 30
-#include <fuse.h>
 #include <fuse_lowlevel.h>
-#include "include/ceph_fuse.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
index e7c8166542a7dd849711c17f7ee959c4ac6ec0b2..6d6db311929c5899b40df42de9ae365b671dab5a 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * rbd-fuse
  */
-#define FUSE_USE_VERSION 30
-
 #include "include/int_types.h"
 
 #include <stdio.h>
@@ -11,7 +9,6 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <fuse.h>
 #include <pthread.h>
 #include <string.h>
 #include <sys/types.h>