Signed-off-by: Sage Weil <sage@redhat.com>
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);
}
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;
}
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();
}