From b4330832cdec6f6622159c304dca4939798dded7 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Sun, 6 Sep 2015 16:03:45 +0800 Subject: [PATCH] compat: include proper headers for FreeBSD Signed-off-by: Yan, Zheng --- src/ceph_fuse.cc | 2 +- src/client/fuse_ll.cc | 2 ++ src/common/ipaddr.cc | 1 + src/common/sync_filesystem.h | 10 ++++------ src/common/util.cc | 2 +- src/msg/async/EventKqueue.h | 1 + src/msg/simple/Pipe.cc | 2 ++ src/os/GenericFileStoreBackend.cc | 4 ++-- src/os/chain_xattr.h | 2 +- src/os/fs/FS.cc | 2 +- src/rbd_fuse/rbd-fuse.cc | 4 ++++ src/rbd_replay/Deser.cc | 2 +- src/rbd_replay/Ser.cc | 2 +- 13 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 9fd8d0e950a..0c5dc3d080f 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -34,7 +34,7 @@ using namespace std; #include "global/global_init.h" #include "common/safe_io.h" -#ifndef DARWIN +#if !defined(DARWIN) && !defined(__FreeBSD__) #include #endif // DARWIN diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 410509d7c8f..67c7e97a97b 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -14,6 +14,8 @@ #define FUSE_USE_VERSION 30 +#include +#include #include #include #include diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 3147d377f54..abf09b0ae0f 100644 --- a/src/common/ipaddr.cc +++ b/src/common/ipaddr.cc @@ -1,5 +1,6 @@ #include "include/ipaddr.h" +#include #include #include #include diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h index 8f45d04b3f6..a664a86d308 100644 --- a/src/common/sync_filesystem.h +++ b/src/common/sync_filesystem.h @@ -17,12 +17,10 @@ #include -#ifndef __CYGWIN__ -# ifndef DARWIN -# include -# include -# include "../os/btrfs_ioctl.h" -# endif +#if defined(__linux__) +#include +#include +#include "../os/btrfs_ioctl.h" #endif inline int sync_filesystem(int fd) diff --git a/src/common/util.cc b/src/common/util.cc index f8959e4644f..f9262f3aac1 100644 --- a/src/common/util.cc +++ b/src/common/util.cc @@ -25,7 +25,7 @@ #include #endif -#if defined(DARWIN) +#if defined(DARWIN) || defined(__FreeBSD__) #include #include #endif diff --git a/src/msg/async/EventKqueue.h b/src/msg/async/EventKqueue.h index 52d9c7290f2..c7f99a73de6 100644 --- a/src/msg/async/EventKqueue.h +++ b/src/msg/async/EventKqueue.h @@ -17,6 +17,7 @@ #ifndef CEPH_MSG_EVENTKQUEUE_H #define CEPH_MSG_EVENTKQUEUE_H +#include #include #include diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index fb04c425b4a..d1483785de7 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -12,7 +12,9 @@ * */ +#include #include +#include #include #include #include diff --git a/src/os/GenericFileStoreBackend.cc b/src/os/GenericFileStoreBackend.cc index 9d74df769e0..4bba4130ccf 100644 --- a/src/os/GenericFileStoreBackend.cc +++ b/src/os/GenericFileStoreBackend.cc @@ -281,7 +281,7 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f fiemap->fm_length = len + start % CEPH_PAGE_SIZE; fiemap->fm_flags = FIEMAP_FLAG_SYNC; /* flush extents to disk if needed */ -#if defined(DARWIN) +#if defined(DARWIN) || defined(__FreeBSD__) ret = -ENOTSUP; goto done_err; #else @@ -305,7 +305,7 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f fiemap->fm_extent_count = fiemap->fm_mapped_extents; fiemap->fm_mapped_extents = 0; -#if defined(DARWIN) +#if defined(DARWIN) || defined(__FreeBSD__) ret = -ENOTSUP; goto done_err; #else diff --git a/src/os/chain_xattr.h b/src/os/chain_xattr.h index 65460b2aa6e..b994d5209b8 100644 --- a/src/os/chain_xattr.h +++ b/src/os/chain_xattr.h @@ -11,7 +11,7 @@ #if defined(__linux__) #include #define CHAIN_XATTR_MAX_NAME_LEN ((XATTR_NAME_MAX + 1) / 2) -#elif defined(__APPLE__) || defined(__FreeBSD__) +#elif defined(__APPLE__) #include #define CHAIN_XATTR_MAX_NAME_LEN ((XATTR_MAXNAMELEN + 1) / 2) #else diff --git a/src/os/fs/FS.cc b/src/os/fs/FS.cc index 5df8adf7d79..cb0bdd53a13 100644 --- a/src/os/fs/FS.cc +++ b/src/os/fs/FS.cc @@ -30,7 +30,7 @@ #include "XFS.h" #endif -#ifdef DARWIN +#if defined(DARWIN) || defined(__FreeBSD__) #include #else #include diff --git a/src/rbd_fuse/rbd-fuse.cc b/src/rbd_fuse/rbd-fuse.cc index 5cc89002c4f..8abfe45b5d1 100644 --- a/src/rbd_fuse/rbd-fuse.cc +++ b/src/rbd_fuse/rbd-fuse.cc @@ -19,6 +19,10 @@ #include #include +#if defined(__FreeBSD__) +#include +#endif + #include "include/compat.h" #include "include/rbd/librbd.h" diff --git a/src/rbd_replay/Deser.cc b/src/rbd_replay/Deser.cc index af7992382f4..972db9b3ef0 100644 --- a/src/rbd_replay/Deser.cc +++ b/src/rbd_replay/Deser.cc @@ -15,7 +15,7 @@ #include "Deser.hpp" #include #include -#if defined(DARWIN) +#if defined(DARWIN) || defined(__FreeBSD__) #include #else #include diff --git a/src/rbd_replay/Ser.cc b/src/rbd_replay/Ser.cc index bc3e3777b32..4b721ab7205 100644 --- a/src/rbd_replay/Ser.cc +++ b/src/rbd_replay/Ser.cc @@ -16,7 +16,7 @@ #include "Ser.hpp" #include #include -#if defined(DARWIN) +#if defined(DARWIN) || defined(__FreeBSD__) #include #else #include