From: Adam Kupczyk Date: Thu, 25 Jul 2024 07:47:04 +0000 (+0000) Subject: os/bluestore: Add compression fallback X-Git-Tag: v20.0.0~1280^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b5b7fa4fce3af3d39e7fda58cec962e57aaa83b;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fe14a13f6491..299cd90d0006 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);