Skip to content

Commit

Permalink
Merge pull request #11012 from majianpeng/bluefs-buffered-io
Browse files Browse the repository at this point in the history
os/bluestore/BlueFS: For logs of rocksdb & bluefs only use directio.

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Sep 8, 2016
2 parents 718d6c2 + 7d1d689 commit 73e4d2d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/os/bluestore/BlueFS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,12 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
assert(!h->file->deleted);
assert(h->file->num_readers.load() == 0);

bool buffered;
if (h->file->fnode.ino == 1 || h->writer_type == WRITER_WAL)
buffered = false;
else
buffered = g_conf->bluefs_buffered_io;

if (offset + length <= h->pos)
return 0;
if (offset < h->pos) {
Expand Down Expand Up @@ -1506,8 +1512,7 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
h->tail_block.substr_of(bl, bl.length() - tail, tail);
t.append_zero(super.block_size - tail);
}
bdev[p->bdev]->aio_write(p->offset + x_off, t, h->iocv[p->bdev],
g_conf->bluefs_buffered_io);
bdev[p->bdev]->aio_write(p->offset + x_off, t, h->iocv[p->bdev], buffered);
bloff += x_len;
length -= x_len;
++p;
Expand Down

0 comments on commit 73e4d2d

Please sign in to comment.