]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: print warning about missing fs features
authorNoah Watkins <noahwatkins@gmail.com>
Sun, 29 Dec 2013 20:59:15 +0000 (12:59 -0800)
committerNoah Watkins <noahwatkins@gmail.com>
Sun, 29 Dec 2013 21:32:00 +0000 (13:32 -0800)
- sync
- posix_fadvise

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/test/bench/dumb_backend.cc
src/test/bench/small_io_bench_dumb.cc

index c36dce392da6565e0a10a124daa186d74cb6a1a6..bf78ab22572e76bfe31092fa4887ff08a3fa3bb2 100644 (file)
@@ -1,5 +1,7 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 
+#include "acconfig.h"
+
 #include <unistd.h>
 #include "dumb_backend.h"
 
@@ -34,15 +36,23 @@ void DumbBackend::_write(
   on_applied->complete(0);
   if (do_fsync)
     ::fsync(fd);
+#ifdef HAVE_SYNC_FILE_RANGE
   if (do_sync_file_range)
     ::sync_file_range(fd, offset, bl.length(),
                      SYNC_FILE_RANGE_WAIT_AFTER);
+#else
+# warning "sync_file_range not supported!"
+#endif
+#ifdef HAVE_POSIX_FADVISE
   if (do_fadvise) {
     int fa_r = ::posix_fadvise(fd, offset, bl.length(), POSIX_FADV_DONTNEED);
     if (fa_r) {
         std::cout << "posix_fadvise failed, errno is: " << fa_r << std::endl;
     }
   }
+#else
+# warning "posix_fadvise not supported!"
+#endif
   ::close(fd);
   {
     Mutex::Locker l(pending_commit_mutex);
index 6d79fdd53d0408ad0a24ab2511938bf00e196652..73841c3c6e40d4a75adc08c32fdce24384ef5f47 100644 (file)
@@ -1,5 +1,7 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 
+#include "acconfig.h"
+
 #include <boost/scoped_ptr.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/program_options/option.hpp>
@@ -191,6 +193,16 @@ int main(int argc, char **argv)
       );
   }
 
+#ifndef HAVE_SYNC_FILE_RANGE
+  if (vm["sync-file-range"].as<bool>())
+    std::cerr << "Warning: sync_file_range(2) not supported!" << std::endl;
+#endif
+
+#ifndef HAVE_POSIX_FADVISE
+  if (vm["fadvise"].as<bool>())
+    std::cerr << "Warning: posix_fadvise(2) not supported!" << std::endl;
+#endif
+
   Bencher bencher(
     gen,
     new DetailedStatCollector(1, new JSONFormatter, detailed_ops, &cout),