]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: keep bool random in FileReader
authorSage Weil <sage@redhat.com>
Mon, 4 Jan 2016 17:54:06 +0000 (12:54 -0500)
committerSage Weil <sage@redhat.com>
Fri, 8 Jan 2016 18:10:17 +0000 (13:10 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index 2d24c283d49e215d568b120c46dddeddbba940e0..09320a22c47a2b1addec481842d6074a9a66aee7 100644 (file)
@@ -340,6 +340,7 @@ int BlueFS::_replay()
 
   FileReader *log_reader = new FileReader(
     log_file, g_conf->bluefs_alloc_size,
+    false,  // !random
     true);  // ignore eof
   while (true) {
     assert((log_reader->buf.pos & ~super.block_mask()) == 0);
@@ -1266,7 +1267,8 @@ int BlueFS::open_for_read(
   }
   File *file = q->second.get();
 
-  *h = new FileReader(file, random ? 4096 : g_conf->bluefs_max_prefetch);
+  *h = new FileReader(file, random ? 4096 : g_conf->bluefs_max_prefetch,
+                     random, false);
   dout(10) << __func__ << " h " << *h << " on " << file->fnode << dendl;
   return 0;
 }
index 2ce5ec331b853e2fd843200daea13abc19b54e60..5fb703964e8b4d0ba464b5ba362c129262777a09 100644 (file)
@@ -127,11 +127,13 @@ public:
   struct FileReader {
     FileRef file;
     FileReaderBuffer buf;
+    bool random;
     bool ignore_eof;        ///< used when reading our log file
 
-    FileReader(FileRef f, uint64_t mpf, bool ie = false)
+    FileReader(FileRef f, uint64_t mpf, bool rand, bool ie)
       : file(f),
        buf(mpf),
+       random(rand),
        ignore_eof(ie) {
       file->num_readers.inc();
     }