]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cache: add comments about the correct usage
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 31 Jul 2024 06:45:19 +0000 (14:45 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 1 Aug 2024 07:21:41 +0000 (15:21 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/btree/fixed_kv_btree.h
src/crimson/os/seastore/cache.h

index 097072a74348a9144106d8745afd3d0f66b8b557..0671b55a4fb5a5ef49e4edc42a852937f8c008cf 100644 (file)
@@ -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 =
index 0e4e14f557422fb955e1f999b1be668a84e18ba2..9922fcdf4df43b65b26e29b2eb80d4a395a0beb3 100644 (file)
@@ -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 <typename T>
   get_extent_iertr::future<TCachedExtentRef<T>> 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 <typename Func>
   get_extent_by_type_ret get_absent_extent_by_type(