From: Adam Kupczyk Date: Tue, 1 Jul 2025 11:54:01 +0000 (+0000) Subject: os/bluestore: Tiny refactor X-Git-Tag: v21.0.1~8^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0bf7dede5a64e3bbcde2fe496992c5eea21284e;p=ceph.git os/bluestore: Tiny refactor Moved statfs initialization that is done after onode recovery from read_allocation_from_onodes() to reconstruct_allocations(). Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d74b11bbdaa..12cb8573f18 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -20875,6 +20875,23 @@ int BlueStore::read_allocation_from_onodes(SimpleBitmap *sbmap, read_alloc_stats ++stats.shard_count; } } + return 0; +} + +//--------------------------------------------------------- +int BlueStore::reconstruct_allocations(SimpleBitmap *sbmap, read_alloc_stats_t &stats) +{ + // first set space used by superblock + auto super_length = std::max(min_alloc_size, SUPER_RESERVED); + set_allocation_in_simple_bmap(sbmap, 0, super_length); + stats.extent_count++; + + // then set all space taken by Objects + int ret = read_allocation_from_onodes(sbmap, stats); + if (ret < 0) { + derr << "failed read_allocation_from_onodes()" << dendl; + return ret; + } std::lock_guard l(vstatfs_lock); store_statfs_t s; @@ -20896,23 +20913,6 @@ int BlueStore::read_allocation_from_onodes(SimpleBitmap *sbmap, read_alloc_stats vstatfs.publish(&s); dout(5) << __func__ << " recovered " << s << dendl; - return 0; -} - -//--------------------------------------------------------- -int BlueStore::reconstruct_allocations(SimpleBitmap *sbmap, read_alloc_stats_t &stats) -{ - // first set space used by superblock - auto super_length = std::max(min_alloc_size, SUPER_RESERVED); - set_allocation_in_simple_bmap(sbmap, 0, super_length); - stats.extent_count++; - - // then set all space taken by Objects - int ret = read_allocation_from_onodes(sbmap, stats); - if (ret < 0) { - derr << "failed read_allocation_from_onodes()" << dendl; - return ret; - } return 0; }