mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
os/bluestore: Split BlueStore::_do_remove()
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>
This commit is contained in:
parent
29bae567fc
commit
50a1037da8
@ -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.
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user