]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Tue, 7 Mar 2023 09:04:07 +0000 (09:04 +0000)
commit3ea1d8e09d43a742d52931bbc508f80cdd8ceaa0
tree5b3f9c5b36d88bf9e91e2850edec160501ff0056
parent4bf99c69f2506babc566395ea1f090c30bd70d30
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>
src/crimson/osd/object_context_loader.cc
src/crimson/osd/object_context_loader.h
src/crimson/osd/osd_operations/snaptrim_event.cc