]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-fuse: fix compilation on OSX
authorYan, Zheng <zyan@redhat.com>
Sun, 31 Jan 2016 02:01:51 +0000 (10:01 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 18 Jul 2016 03:08:48 +0000 (11:08 +0800)
Osxfuse does not define FUSE_CAP_DONT_MASK/FUSE_SET_ATTR_ATIME_NOW.
Besides, its header files are under osxfuse/ directory.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/Makefile-client.am
src/client/fuse_ll.cc
src/client/fuse_ll.h
src/client/ioctl.h
src/os/FuseStore.cc
src/os/Makefile.am

index 98e8ebb74d299ed214053be6dd100b37683bd8f8..ed257cd32e8919d9bbbef2b309e9fc1e008ccfcd 100644 (file)
@@ -61,6 +61,7 @@ endif # WITH_RBD
 if WITH_FUSE
 ceph_fuse_SOURCES = ceph_fuse.cc
 ceph_fuse_LDADD = $(LIBCLIENT_FUSE) $(CEPH_GLOBAL)
+ceph_fuse_CXXFLAGS = $(AM_CXXFLAGS) $(LIBFUSE_CFLAGS)
 bin_PROGRAMS += ceph-fuse
 
 if WITH_RBD
index 9e4babed1f76e677d613be44807dc34226474074..de14029943d1be19ef636098396533e8d720dea9 100644 (file)
@@ -12,8 +12,6 @@
  * 
  */
 
-#define FUSE_USE_VERSION 30
-
 #include <sys/file.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -35,9 +33,9 @@
 #include "common/config.h"
 #include "include/assert.h"
 
+#include "fuse_ll.h"
 #include <fuse.h>
 #include <fuse_lowlevel.h>
-#include "fuse_ll.h"
 
 #define FINO_INO(x) ((x) & ((1ull<<48)-1ull))
 #define FINO_STAG(x) ((x) >> 48)
@@ -172,8 +170,10 @@ static void fuse_ll_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
   if (to_set & FUSE_SET_ATTR_MTIME) mask |= CEPH_SETATTR_MTIME;
   if (to_set & FUSE_SET_ATTR_ATIME) mask |= CEPH_SETATTR_ATIME;
   if (to_set & FUSE_SET_ATTR_SIZE) mask |= CEPH_SETATTR_SIZE;
+#if !defined(DARWIN)
   if (to_set & FUSE_SET_ATTR_MTIME_NOW) mask |= CEPH_SETATTR_MTIME_NOW;
   if (to_set & FUSE_SET_ATTR_ATIME_NOW) mask |= CEPH_SETATTR_ATIME_NOW;
+#endif
 
   int r = cfuse->client->ll_setattr(in, attr, mask, ctx->uid, ctx->gid);
   if (r == 0)
@@ -800,6 +800,7 @@ static int getgroups_cb(void *handle, gid_t **sgids)
 #endif
 }
 
+#if !defined(DARWIN)
 static mode_t umask_cb(void *handle)
 {
   CephFuse::Handle *cfuse = (CephFuse::Handle *)handle;
@@ -807,6 +808,7 @@ static mode_t umask_cb(void *handle)
   const struct fuse_ctx *ctx = fuse_req_ctx(req);
   return ctx->umask;
 }
+#endif
 
 static void ino_invalidate_cb(void *handle, vinodeno_t vino, int64_t off,
                              int64_t len)
@@ -853,12 +855,14 @@ static void do_init(void *data, fuse_conn_info *conn)
   CephFuse::Handle *cfuse = (CephFuse::Handle *)data;
   Client *client = cfuse->client;
 
+#if !defined(DARWIN)
   if (!client->cct->_conf->fuse_default_permissions &&
       client->ll_handle_umask()) {
     // apply umask in userspace if posix acl is enabled
     if(conn->capable & FUSE_CAP_DONT_MASK)
       conn->want |= FUSE_CAP_DONT_MASK;
   }
+#endif
 
   if (cfuse->fd_on_success) {
     //cout << "fuse init signaling on fd " << fd_on_success << std::endl;
@@ -1057,7 +1061,9 @@ int CephFuse::Handle::start()
     remount_cb: remount_cb,
 #endif
     getgroups_cb: getgroups_cb,
+#if !defined(DARWIN)
     umask_cb: umask_cb,
+#endif
   };
   client->ll_register_callbacks(&args);
 
index 85e587baf46b55acac1de0cf5c06995ebc4e8f50..3d7b891ddb44a1a48de71585d0450219954c315f 100644 (file)
@@ -12,6 +12,8 @@
  * 
  */
 
+#define FUSE_USE_VERSION 30
+
 class CephFuse {
 public:
   CephFuse(Client *c, int fd);
index 35b4ce4ac0f328d1cb0627a7f0ac78e7f6985378..1cf133ae955333c0218a3d21d735a5a2ffbeaf9d 100644 (file)
@@ -6,7 +6,7 @@
 #if defined(__linux__)
 #include <linux/ioctl.h>
 #include <linux/types.h>
-#elif defined(__FreeBSD__)
+#elif defined(DARWIN) || defined(__FreeBSD__)
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #endif
index cd3bed3be8286b8a1db86f5189e7bd7b98b90afb..cf62555bad179b05f872d5eb5eee83b0c033f332 100644 (file)
@@ -6,7 +6,7 @@
 #include "common/errno.h"
 
 #define FUSE_USE_VERSION 30
-#include <fuse/fuse.h>
+#include <fuse.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 98186e271ccef6322c9c2f274c47207707b2d433..4ec29c53b531d0ee4d570587569dd373a32c3d69 100644 (file)
@@ -30,8 +30,13 @@ libos_a_SOURCES = \
        os/memstore/MemStore.cc \
        os/ObjectStore.cc
 
+libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I rocksdb/include -fPIC
+libos_a_LIBADD = libos_types.a libkv.a
+noinst_LIBRARIES += libos.a
+
 if WITH_FUSE
 libos_a_SOURCES += os/FuseStore.cc
+libos_a_CXXFLAGS += $(LIBFUSE_CFLAGS)
 endif
 
 if WITH_LIBAIO
@@ -65,10 +70,6 @@ if WITH_LIBZFS
 libos_a_SOURCES += os/filestore/ZFSFileStoreBackend.cc
 endif
 
-libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I rocksdb/include -fPIC
-libos_a_LIBADD = libos_types.a libkv.a
-noinst_LIBRARIES += libos.a
-
 if WITH_LTTNG
 libos_a_LIBADD += $(LIBOS_TP)
 endif