From 387209775be40da1001cc64696fa847983602b4d Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 18 Nov 2019 12:29:51 +0300 Subject: [PATCH] os/bluestore: rename apply to apply_for_bitset_range Signed-off-by: Igor Fedotov --- src/os/bluestore/BlueFS.cc | 18 +++++++++--------- src/os/bluestore/BlueStore.cc | 12 ++++++------ src/os/bluestore/bluestore_common.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 519a429003a..6de7df5f491 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -767,7 +767,7 @@ int BlueFS::_check_new_allocations(const bluefs_fnode_t& fnode, auto id = e.bdev; bool fail = false; ceph_assert(id < dev_count); - apply(e.offset, e.length, alloc_size[id], owned_blocks[id], + apply_for_bitset_range(e.offset, e.length, alloc_size[id], owned_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (!bs.test(pos)) { @@ -784,7 +784,7 @@ int BlueFS::_check_new_allocations(const bluefs_fnode_t& fnode, return -EFAULT; } - apply(e.offset, e.length, alloc_size[id], used_blocks[id], + apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (bs.test(pos)) { @@ -1028,7 +1028,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) if (cct->_conf->bluefs_log_replay_check_allocations) { bool fail = false; - apply(offset, length, alloc_size[id], owned_blocks[id], + apply_for_bitset_range(offset, length, alloc_size[id], owned_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (bs.test(pos)) { @@ -1044,7 +1044,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) << std::dec << ": already given" << dendl; return -EFAULT; } - apply(offset, length, alloc_size[id], used_blocks[id], + apply_for_bitset_range(offset, length, alloc_size[id], used_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -1087,7 +1087,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) alloc[id]->init_rm_free(offset, length); if (cct->_conf->bluefs_log_replay_check_allocations) { bool fail = false; - apply(offset, length, alloc_size[id], owned_blocks[id], + apply_for_bitset_range(offset, length, alloc_size[id], owned_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (!bs.test(pos)) { @@ -1104,7 +1104,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) return -EFAULT; } - apply(offset, length, alloc_size[id], used_blocks[id], + apply_for_bitset_range(offset, length, alloc_size[id], used_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (bs.test(pos)) { @@ -1246,7 +1246,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) auto& fnode_extents = f->fnode.extents; for (auto e : fnode_extents) { auto id = e.bdev; - apply(e.offset, e.length, alloc_size[id], used_blocks[id], + apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); ceph_assert(bs.test(pos)); @@ -1290,7 +1290,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) for (auto e : fnode_extents) { auto id = e.bdev; bool fail = false; - apply(e.offset, e.length, alloc_size[id], owned_blocks[id], + apply_for_bitset_range(e.offset, e.length, alloc_size[id], owned_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (!bs.test(pos)) { @@ -1307,7 +1307,7 @@ int BlueFS::_replay(bool noop, bool to_stdout) return -EFAULT; } - apply(e.offset, e.length, alloc_size[id], used_blocks[id], + apply_for_bitset_range(e.offset, e.length, alloc_size[id], used_blocks[id], [&](uint64_t pos, boost::dynamic_bitset &bs) { ceph_assert(pos < bs.size()); if (!bs.test(pos)) { diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6e375950cbf..f6ccca88047 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7023,7 +7023,7 @@ int BlueStore::_fsck_check_extents( } if (depth != FSCK_SHALLOW) { bool already = false; - apply( + apply_for_bitset_range( e.offset, e.length, granularity, used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -8083,7 +8083,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) _fsck_collections(&errors); used_blocks.resize(fm->get_alloc_units()); - apply( + apply_for_bitset_range( 0, std::max(min_alloc_size, SUPER_RESERVED), fm->get_alloc_size(), used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -8124,7 +8124,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) } for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) { - apply( + apply_for_bitset_range( e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -8598,7 +8598,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) << " ops " << wt.ops.size() << " released 0x" << std::hex << wt.released << std::dec << dendl; for (auto e = wt.released.begin(); e != wt.released.end(); ++e) { - apply( + apply_for_bitset_range( e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -8614,7 +8614,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) // remove bluefs_extents from used set since the freelist doesn't // know they are allocated. for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) { - apply( + apply_for_bitset_range( e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); @@ -8626,7 +8626,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) uint64_t offset, length; while (fm->enumerate_next(db, &offset, &length)) { bool intersects = false; - apply( + apply_for_bitset_range( offset, length, fm->get_alloc_size(), used_blocks, [&](uint64_t pos, mempool_dynamic_bitset &bs) { ceph_assert(pos < bs.size()); diff --git a/src/os/bluestore/bluestore_common.h b/src/os/bluestore/bluestore_common.h index b9b3a4e0535..876a9c2b24f 100755 --- a/src/os/bluestore/bluestore_common.h +++ b/src/os/bluestore/bluestore_common.h @@ -18,7 +18,7 @@ #include "include/intarith.h" template -void apply(uint64_t off, +void apply_for_bitset_range(uint64_t off, uint64_t len, uint64_t granularity, Bitset &bitset, -- 2.39.5