]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: Introduce with_head_and_clone_obc()
authorMatan Breizman <mbreizma@redhat.com>
Sun, 5 Mar 2023 09:31:03 +0000 (09:31 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 08:12:30 +0000 (08:12 +0000)
commitbf5b9e03b792386f5bb6147fc48d6b99f1b4d97b
tree1483c28d69163d110aecfcc1baac3a3976b574ae
parentf1bd57c05e74fdff61f00d774ecdd52dc1a12757
crimson/osd: Introduce with_head_and_clone_obc()

In continuation to 7ca2690be956a36f61c7729946b94ccd970dd9c7:
Now that the head ref is no longer a member of obc, we need a new
substitute way to get the head when needed.

When loading a clone object, the head object is loaded
first (See with_clone_obc). Therefore we can make use of this design
to move the loaded head forward to the relevant func (See with_head_and_clone_obc).
Usually, we wouldn't need to make use of both the head and the clone obc in the
same function. However, SnapTrimObjSubEvent::remove_or_update is an abnormal usage.

Note: We want to avoid holding any unneeded references to obcs
to allow the obc_registery to evict no longer valid obc.
Therefore, with_obc() which references only a single obc is the
preferred entry point for loading obcs.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit 3ea1d8e09d43a742d52931bbc508f80cdd8ceaa0)
src/crimson/osd/object_context_loader.cc
src/crimson/osd/object_context_loader.h
src/crimson/osd/osd_operations/snaptrim_event.cc