]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Add compression fallback
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 25 Jul 2024 07:47:04 +0000 (07:47 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 7 Aug 2024 10:55:46 +0000 (10:55 +0000)
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 <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index fe14a13f649112654d1d6ead28d9d1b4c30bc527..299cd90d0006cc32936ffe6376b758136eb89ff6 100644 (file)
@@ -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);