From: Samuel Just Date: Tue, 26 Jan 2021 00:13:46 +0000 (-0800) Subject: crimson/os/seastore/transaction_manager: wire up collection_manager root X-Git-Tag: v17.1.0~2805^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b3f288e969894141bb94a2d0cc7a2b055652150;p=ceph.git crimson/os/seastore/transaction_manager: wire up collection_manager root Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/root_block.h b/src/crimson/os/seastore/root_block.h index 4a5024caa62f..1e8ba9f5de88 100644 --- a/src/crimson/os/seastore/root_block.h +++ b/src/crimson/os/seastore/root_block.h @@ -19,6 +19,7 @@ struct __attribute__((aligned(8), packed)) root_t { paddr_t lba_root_addr; paddr_t segment_root; laddr_t onode_root = L_ADDR_NULL; + laddr_t collection_root = L_ADDR_NULL; void adjust_addrs_from_base(paddr_t base) { if (lba_root_addr.is_relative()) { diff --git a/src/crimson/os/seastore/transaction_manager.h b/src/crimson/os/seastore/transaction_manager.h index 0bfc9d6e2b58..c978ed5a1e70 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -323,7 +323,7 @@ public: * * Get onode-tree root logical address */ - using read_onode_root_ertr = read_extent_ertr; + using read_onode_root_ertr = base_ertr; using read_onode_root_ret = read_onode_root_ertr::future; read_onode_root_ret read_onode_root(Transaction &t) { return cache.get_root(t).safe_then([](auto croot) { @@ -342,6 +342,30 @@ public: croot->get_root().onode_root = addr; } + /** + * read_collection_root + * + * Get collection root addr + */ + using read_collection_root_ertr = base_ertr; + using read_collection_root_ret = read_collection_root_ertr::future; + read_collection_root_ret read_collection_root(Transaction &t) { + return cache.get_root(t).safe_then([](auto croot) { + return croot->get_root().collection_root; + }); + } + + /** + * write_collection_root + * + * Update collection root addr + */ + void write_collection_root(Transaction &t, laddr_t addr) { + auto croot = cache.get_root_fast(t); + croot = cache.duplicate_for_write(t, croot)->cast(); + croot->get_root().collection_root = addr; + } + ~TransactionManager(); private: