From: Yingxin Cheng Date: Wed, 31 Jul 2024 06:45:19 +0000 (+0800) Subject: crimson/os/seastore/cache: add comments about the correct usage X-Git-Tag: v20.0.0~1307^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d056148d5d9cb65f451232561de919e0d993179;p=ceph.git crimson/os/seastore/cache: add comments about the correct usage Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/btree/fixed_kv_btree.h b/src/crimson/os/seastore/btree/fixed_kv_btree.h index 097072a74348..0671b55a4fb5 100644 --- a/src/crimson/os/seastore/btree/fixed_kv_btree.h +++ b/src/crimson/os/seastore/btree/fixed_kv_btree.h @@ -1383,6 +1383,9 @@ private: "looking up root on {}", c.trans, *root_block); + + // checking the lba root node must be atomic with creating + // and linking the absent root node auto [found, fut] = get_root_node(c); auto on_found_internal = diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 0e4e14f55742..9922fcdf4df4 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -437,6 +437,11 @@ public: * Mostly the same as Cache::get_extent(), with the only difference * that get_absent_extent won't search the transaction's context for * the specific CachedExtent + * + * The extent in query is supposed to be absent in Cache. + * + * User is responsible to call get_extent_viewable_by_trans() + * *atomically* prior to call this method. */ template get_extent_iertr::future> get_absent_extent( @@ -784,6 +789,9 @@ public: * and read in the extent at location offset~length. * * The extent in query is supposed to be absent in Cache. + * + * User is responsible to call get_extent_viewable_by_trans() + * *atomically* prior to call this method. */ template get_extent_by_type_ret get_absent_extent_by_type(