From: Samuel Just Date: Fri, 21 Aug 2020 05:12:05 +0000 (-0700) Subject: crimson/os/seastore/cache: let root exist in the dirty list X-Git-Tag: v16.1.0~983^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=31d3057a35e45c9c59d89e5b5d8e0f68f7dab313;p=ceph.git crimson/os/seastore/cache: let root exist in the dirty list Most handling remains special, but this way the dirty list we work on will include root directly. Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index e5b98c337efa..25d20be3fabb 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -198,9 +198,12 @@ void Cache::complete_commit( paddr_t final_block_start) { if (t.root) { + remove_extent(root); root = t.root; - root->on_delta_write(final_block_start); root->state = CachedExtent::extent_state_t::DIRTY; + root->on_delta_write(final_block_start); + root->dirty_from = seq; + add_extent(root); logger().debug("complete_commit: new root {}", *t.root); } @@ -242,8 +245,14 @@ void Cache::complete_commit( } void Cache::init() { + if (root) { + // initial creation will do mkfs followed by mount each of which calls init + remove_extent(root); + root = nullptr; + } root = new RootBlock(); root->state = CachedExtent::extent_state_t::DIRTY; + add_extent(root); } Cache::mkfs_ertr::future<> Cache::mkfs(Transaction &t)