]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
syncfs: check for __NR_syncfs too
authorSage Weil <sage@inktank.com>
Sun, 25 Nov 2012 21:29:52 +0000 (13:29 -0800)
committerSage Weil <sage@inktank.com>
Sun, 25 Nov 2012 21:29:52 +0000 (13:29 -0800)
Also make the filestore startup tell us *all* variants that are
supported, not just the first one.

Tested-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/sync_filesystem.h
src/os/FileStore.cc

index dc90b890c93c65c5c5ad4253f82a723c71277877..5b23576ff4cdc69e2e98eda69144e97d88ada557 100644 (file)
@@ -41,6 +41,11 @@ inline int sync_filesystem(int fd)
     return 0;
 #endif
 
+#ifdef __NR_syncfs
+  if (syscall(__NR_syncfs, fd) == 0)
+    return 0;
+#endif
+
 #ifdef BTRFS_IOC_SYNC
   if (::ioctl(fd, BTRFS_IOC_SYNC) == 0)
     return 0;
index 1d6797c2b32148ea66ecedfb9e0af1b8eaf3bdd1..70eef5ae13f68aed71f972ceeacbed8e50bfae31 100644 (file)
@@ -1227,7 +1227,7 @@ int FileStore::_detect_fs()
   } else {
     dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl;
   }
-#else
+#endif
 #ifdef SYS_syncfs
   if (syscall(SYS_syncfs, fd) == 0) {
     dout(0) << "mount syscall(SYS_syncfs, fd) fully supported" << dendl;
@@ -1235,11 +1235,17 @@ int FileStore::_detect_fs()
   } else {
     dout(0) << "mount syscall(SYS_syncfs, fd) supported by libc BUT NOT the kernel" << dendl;
   }
-#else
-  dout(0) << "mount syncfs(2) syscall not support by glibc" << dendl;
 #endif
+#ifdef __NR_syncfs
+  if (syscall(__NR_syncfs, fd) == 0) {
+    dout(0) << "mount syscall(__NR_syncfs, fd) fully supported" << dendl;
+    have_syncfs = true;
+  } else {
+    dout(0) << "mount syscall(__NR_syncfs, fd) supported by libc BUT NOT the kernel" << dendl;
+  }
 #endif
   if (!have_syncfs) {
+    dout(0) << "mount syncfs(2) syscall not supported" << dendl;
     if (btrfs) {
       dout(0) << "mount no syncfs(2), but the btrfs SYNC ioctl will suffice" << dendl;
     } else if (m_filestore_fsync_flushes_journal_data) {