From: Yan, Zheng Date: Sun, 31 Jan 2016 02:01:51 +0000 (+0800) Subject: ceph-fuse: fix compilation on OSX X-Git-Tag: ses5-milestone5~283^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ddb4a28f4093128d35e14472a09907a4c228668a;p=ceph.git ceph-fuse: fix compilation on OSX 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 --- diff --git a/src/Makefile-client.am b/src/Makefile-client.am index 98e8ebb74d2..ed257cd32e8 100644 --- a/src/Makefile-client.am +++ b/src/Makefile-client.am @@ -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 diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 9e4babed1f7..de14029943d 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -12,8 +12,6 @@ * */ -#define FUSE_USE_VERSION 30 - #include #include #include @@ -35,9 +33,9 @@ #include "common/config.h" #include "include/assert.h" +#include "fuse_ll.h" #include #include -#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); diff --git a/src/client/fuse_ll.h b/src/client/fuse_ll.h index 85e587baf46..3d7b891ddb4 100644 --- a/src/client/fuse_ll.h +++ b/src/client/fuse_ll.h @@ -12,6 +12,8 @@ * */ +#define FUSE_USE_VERSION 30 + class CephFuse { public: CephFuse(Client *c, int fd); diff --git a/src/client/ioctl.h b/src/client/ioctl.h index 35b4ce4ac0f..1cf133ae955 100644 --- a/src/client/ioctl.h +++ b/src/client/ioctl.h @@ -6,7 +6,7 @@ #if defined(__linux__) #include #include -#elif defined(__FreeBSD__) +#elif defined(DARWIN) || defined(__FreeBSD__) #include #include #endif diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc index cd3bed3be82..cf62555bad1 100644 --- a/src/os/FuseStore.cc +++ b/src/os/FuseStore.cc @@ -6,7 +6,7 @@ #include "common/errno.h" #define FUSE_USE_VERSION 30 -#include +#include #include #include diff --git a/src/os/Makefile.am b/src/os/Makefile.am index 98186e271cc..4ec29c53b53 100644 --- a/src/os/Makefile.am +++ b/src/os/Makefile.am @@ -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