From 3b5b7fa4fce3af3d39e7fda58cec962e57aaa83b Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 25 Jul 2024 07:47:04 +0000 Subject: [PATCH] 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 --- src/os/bluestore/BlueStore.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fe14a13f64911..299cd90d0006c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -17362,11 +17362,15 @@ int BlueStore::_do_write_v2( if (length == 0) { return 0; } + WriteContext wctx; + _choose_write_options(c, o, fadvise_flags, &wctx); + if (wctx.compress) { + // if we have compression, skip to write_v1 + return _do_write(txc, c, o, offset, length, bl, fadvise_flags); + } if (bl.length() != length) { bl.splice(length, bl.length() - length); } - WriteContext wctx; - _choose_write_options(c, o, fadvise_flags, &wctx); o->extent_map.fault_range(db, offset, length); BlueStore::Writer wr(this, txc, &wctx, o); wr.do_write(offset, bl); -- 2.39.5