]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Split BlueStore::_do_remove()
authorAdam Kupczyk <akupczyk@ibm.com>
Mon, 1 Jun 2026 09:01:50 +0000 (09:01 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Thu, 9 Jul 2026 09:33:35 +0000 (09:33 +0000)
Split BlueStore::_do_remove into 2 parts:
- part that removes object (in _do_remove)
- part that processes head object and tries to unshare blobs
  (new function _maybe_unshare_on_remove)

No logic changes.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index ec470298ea41b9142d6ab4fe57460d577c804f03..4852c020f6b991ea9f5421a1ce363afa5826d3bb 100644 (file)
@@ -18325,10 +18325,18 @@ int BlueStore::_do_remove(
     nogen.hobj.snap = CEPH_NOSNAP;
   OnodeRef h = c->get_onode(nogen, false);
 
-  if (!h || !h->exists) {
-    return 0;
+  if (h && h->exists) {
+    return _maybe_unshare_on_remove(txc, c, h, std::move(maybe_unshared_blobs));
   }
+  return 0;
+}
 
+int BlueStore::_maybe_unshare_on_remove(
+  TransContext *txc,
+  CollectionRef& c,
+  OnodeRef& h,
+  std::set<SharedBlob*>&& maybe_unshared_blobs)
+{
   //Populate the extent map structure from DB; required for shared blob processing below.
   h->extent_map.fault_range(db, 0, h->onode.size);
   // Set maybe_unshared_blobs contains those shared blobs that have all nref=1.
index 6beb08754a23a166c97be19c9ef8ea4297eec412..4457dc86cda22762b1c2e0c033ec2f8bdf4d3a31 100644 (file)
@@ -3970,6 +3970,10 @@ private:
   int _do_remove(TransContext *txc,
                 CollectionRef& c,
                 OnodeRef& o);
+  int _maybe_unshare_on_remove(TransContext *txc,
+                               CollectionRef& c,
+                               OnodeRef& head_o,
+                               std::set<SharedBlob*>&& maybe_unshared_blobs);
   int _setattr(TransContext *txc,
               CollectionRef& c,
               OnodeRef& o,