diff options
| author | Emmanuel Dreyfus <manu@netbsd.org> | 2020-07-22 02:42:44 +0200 | 
|---|---|---|
| committer | Amar Tumballi <amar@kadalu.io> | 2020-07-23 10:30:19 +0000 | 
| commit | 716aeb0ebbfd046e55de4b0f758a4a5eaf7d4e4c (patch) | |
| tree | 370d61cfec6ba10fcf5c93f8c790fac23090af0c | |
| parent | 850b7daf9ba1e7cd28efda3150dd8d11c61e2d27 (diff) | |
Make FUSE notification optional at configure time
NetBSD FUSE does not implement FUSE notification yet. This changes
makes this feature a configure time option so that it can be disabled.
Fixes: #1381
Change-Id: I3d977d8d69b57e1ac6957be84a9ddbb69b100893
Type: Bug
Signed-off-by: Emmanuel Dreyfus manu@netbsd.org
| -rw-r--r-- | configure.ac | 8 | ||||
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 13 | 
2 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 1ab6f080f5d..1078ca8925d 100644 --- a/configure.ac +++ b/configure.ac @@ -698,6 +698,14 @@ if test "x$enable_fuse_client" != "xno"; then  fi  AC_SUBST(FUSE_CLIENT_SUBDIR) + +AC_ARG_ENABLE([fuse-notifications], +  AS_HELP_STRING([--disable-fuse-notifications], [Disable FUSE notifications])) + +AS_IF([test "x$enable_fuse_notifications" != "xno"], [ +  AC_DEFINE([HAVE_FUSE_NOTIFICATIONS], [1], [Use FUSE notifications]) +]) +  # end FUSE section diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 832818688d7..dcafd67b0d6 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -8,6 +8,8 @@    cases as published by the Free Software Foundation.  */ +#include <config.h> +  #include <sys/wait.h>  #include "fuse-bridge.h"  #include <glusterfs/glusterfs.h> @@ -405,7 +407,7 @@ send_fuse_data(xlator_t *this, fuse_in_header_t *finh, void *data, size_t size)  static int32_t  fuse_invalidate_entry(xlator_t *this, uint64_t fuse_ino)  { -#if FUSE_KERNEL_MINOR_VERSION >= 11 +#if (FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS))      struct fuse_out_header *fouh = NULL;      struct fuse_notify_inval_entry_out *fnieo = NULL;      fuse_private_t *priv = NULL; @@ -496,7 +498,7 @@ fuse_invalidate_entry(xlator_t *this, uint64_t fuse_ino)  static int32_t  fuse_invalidate_inode(xlator_t *this, uint64_t fuse_ino)  { -#if FUSE_KERNEL_MINOR_VERSION >= 11 +#if (FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS))      struct fuse_out_header *fouh = NULL;      struct fuse_notify_inval_inode_out *fniio = NULL;      fuse_private_t *priv = NULL; @@ -4918,7 +4920,7 @@ fuse_setlk(xlator_t *this, fuse_in_header_t *finh, void *msg,      return;  } -#if FUSE_KERNEL_MINOR_VERSION >= 11 +#if FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS)  static void *  notify_kernel_loop(void *data)  { @@ -5165,6 +5167,7 @@ fuse_init(xlator_t *this, fuse_in_header_t *finh, void *msg,      priv->timed_response_fuse_thread_started = _gf_true;      /* Used for 'reverse invalidation of inode' */ +#ifdef HAVE_FUSE_NOTIFICATIONS      if (fini->minor >= 12) {          ret = gf_thread_create(&messenger, NULL, notify_kernel_loop, this,                                 "fusenoti"); @@ -5176,7 +5179,9 @@ fuse_init(xlator_t *this, fuse_in_header_t *finh, void *msg,              goto out;          }          priv->reverse_fuse_thread_started = _gf_true; -    } else { +    } else +#endif +    {          /*           * FUSE minor < 12 does not implement invalidate notifications.           * This mechanism is required for fopen-keep-cache to operate  | 
