]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: only use posix_fadvise on linux
authorYan, Zheng <zyan@redhat.com>
Fri, 14 Aug 2015 13:56:16 +0000 (21:56 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 31 Aug 2015 08:00:28 +0000 (16:00 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/tools/rados/PoolDump.cc
src/tools/rados/RadosImport.cc

index 69963ee264d788a920f068430b2e3fe6e36faf76..5d0b3eda6d84ebbc20506d59bafbd5d5d59dbba8 100644 (file)
@@ -161,8 +161,9 @@ int PoolDump::dump(IoCtx *io_ctx)
   }
 
   r = write_simple(TYPE_POOL_END, file_fd);
+#if defined(__linux__)
   if (file_fd != STDOUT_FILENO)
     posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED);
-
+#endif
   return r;
 }
index 32fee3811647bc3bbc268bb7e4a81e3f6553d48c..1f74af2c86cdcce48437595f1c6a0be2594b1cf3 100644 (file)
@@ -110,8 +110,10 @@ int RadosImport::import(librados::IoCtx &io_ctx, bool no_overwrite)
   }
 #endif
 
+#if defined(__linux__)
   if (file_fd != STDIN_FILENO)
     posix_fadvise(file_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+#endif
 
   bool done = false;
   bool found_metadata = false;
@@ -152,8 +154,10 @@ int RadosImport::import(librados::IoCtx &io_ctx, bool no_overwrite)
     cerr << "Missing metadata section!" << std::endl;
   }
 
+#if defined(__linux__)
   if (file_fd != STDIN_FILENO)
     posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED);
+#endif
   return 0;
 }