From: Kefu Chai Date: Wed, 13 Sep 2017 04:17:30 +0000 (+0800) Subject: cmake: check for fdatasync() on non osx X-Git-Tag: v13.0.1~880^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5980a60ab3351215299562f6f44fed7a018d0f47;p=ceph.git cmake: check for fdatasync() on non osx on osx, fdatasync() is a syscall without userspace wrapper. Signed-off-by: Kefu Chai --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f14db6e6e8f..ddbbca4606d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,9 @@ CHECK_FUNCTION_EXISTS(sync_file_range HAVE_SYNC_FILE_RANGE) CHECK_FUNCTION_EXISTS(pwritev HAVE_PWRITEV) CHECK_FUNCTION_EXISTS(splice CEPH_HAVE_SPLICE) CHECK_FUNCTION_EXISTS(getgrouplist HAVE_GETGROUPLIST) -CHECK_FUNCTION_EXISTS(fdatasync HAVE_FDATASYNC) +if(NOT APPLE) + CHECK_FUNCTION_EXISTS(fdatasync HAVE_FDATASYNC) +endif() CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) CHECK_FUNCTION_EXISTS(name_to_handle_at HAVE_NAME_TO_HANDLE_AT) CHECK_FUNCTION_EXISTS(pipe2 HAVE_PIPE2) diff --git a/src/os/filestore/WBThrottle.cc b/src/os/filestore/WBThrottle.cc index 71884445c76..c45f90ca5e8 100644 --- a/src/os/filestore/WBThrottle.cc +++ b/src/os/filestore/WBThrottle.cc @@ -165,7 +165,7 @@ void *WBThrottle::entry() logger->dec(l_wbthrottle_inodes_dirtied); logger->inc(l_wbthrottle_inodes_wb); lock.Unlock(); -#ifdef HAVE_FDATASYNC +#if defined(HAVE_FDATASYNC) ::fdatasync(**wb.get<1>()); #else ::fsync(**wb.get<1>());