Skip to content

Commit 3b5b7fa

Browse files
committed
os/bluestore: Add compression fallback
For write_v2 create fallback to write_v1 if compression is selected. This is temporary until compression dedicated to benefit from v2 is merged. Signed-off-by: Adam Kupczyk <[email protected]>
1 parent 5326fed commit 3b5b7fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/os/bluestore/BlueStore.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -17362,11 +17362,15 @@ int BlueStore::_do_write_v2(
1736217362
if (length == 0) {
1736317363
return 0;
1736417364
}
17365+
WriteContext wctx;
17366+
_choose_write_options(c, o, fadvise_flags, &wctx);
17367+
if (wctx.compress) {
17368+
// if we have compression, skip to write_v1
17369+
return _do_write(txc, c, o, offset, length, bl, fadvise_flags);
17370+
}
1736517371
if (bl.length() != length) {
1736617372
bl.splice(length, bl.length() - length);
1736717373
}
17368-
WriteContext wctx;
17369-
_choose_write_options(c, o, fadvise_flags, &wctx);
1737017374
o->extent_map.fault_range(db, offset, length);
1737117375
BlueStore::Writer wr(this, txc, &wctx, o);
1737217376
wr.do_write(offset, bl);

0 commit comments

Comments
 (0)