From 6ce4744a5ab3c625442ad84d4342bd4e98be1490 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sat, 20 Feb 2016 10:53:49 +0000 Subject: [PATCH] compat: fix build on non-linux Signed-off-by: Mykola Golub --- src/ceph_fuse.cc | 2 ++ src/os/filestore/FileJournal.cc | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 27f430d5a1b..1b72288f5cd 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -30,7 +30,9 @@ using namespace std; #include "common/Timer.h" #include "common/ceph_argparse.h" +#if defined(__linux__) #include "common/linux_version.h" +#endif #include "global/global_init.h" #include "common/safe_io.h" diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index 4e18a5b2a50..9e403101c35 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -33,7 +33,9 @@ #include #include "common/blkdev.h" +#if defined(__linux__) #include "common/linux_version.h" +#endif #if defined(__FreeBSD__) #define O_DSYNC O_SYNC @@ -161,6 +163,11 @@ int FileJournal::_open_block_device() void FileJournal::_check_disk_write_cache() const { +#if !defined(__linux__) + dout(10) << "_check_disk_write_cache: not linux, NOT checking disk write " + << "cache on raw block device " << fn << dendl; + return; +#else ostringstream hdparm_cmd; FILE *fp = NULL; @@ -232,6 +239,7 @@ close_f: } done: ; +#endif // __linux__ } int FileJournal::_open_file(int64_t oldsize, blksize_t blksize,