Skip to content

Commit 48861ec

Browse files
authored
Merge pull request ceph#63059 from Matan-B/wip-matanb-crimson-tentacle-62894
crimson: fix unused variable warnings due to assert() and NDEBUG builds Reviewed-by: Aishwarya Mathuria <[email protected]>
2 parents 024e4d3 + 4c2e698 commit 48861ec

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

src/crimson/os/seastore/btree/fixed_kv_btree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ class FixedKVBtree {
15681568
*parent_entry.node,
15691569
parent_entry.pos,
15701570
*child);
1571-
auto &cnode = (typename internal_node_t::base_t &)*child;
1571+
[[maybe_unused]] auto &cnode = (typename internal_node_t::base_t &)*child;
15721572
assert(cnode.get_node_meta().begin == node_iter.get_key());
15731573
assert(cnode.get_node_meta().end > node_iter.get_key());
15741574
return on_found(child->template cast<leaf_node_t>());

src/crimson/os/seastore/journal/circular_journal_space.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class CircularJournalSpace : public JournalAllocator {
148148
return convert_paddr_to_abs_addr(seq.offset);
149149
}
150150
void set_written_to(journal_seq_t seq) {
151-
rbm_abs_addr addr = convert_paddr_to_abs_addr(seq.offset);
151+
[[maybe_unused]] rbm_abs_addr addr = convert_paddr_to_abs_addr(seq.offset);
152152
assert(addr >= get_records_start());
153153
assert(addr < get_journal_end());
154154
written_to = seq;

src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ class BtreeLBAManager : public LBAManager {
688688
auto ait = alloc_infos.begin();
689689
for (; mit != mappings.end(); mit++, ait++) {
690690
auto mapping = static_cast<BtreeLBAMapping*>(mit->release());
691-
auto &alloc_info = *ait;
691+
[[maybe_unused]] auto &alloc_info = *ait;
692692
assert(mapping->get_key() == alloc_info.key);
693693
assert(mapping->get_raw_val().get_laddr() ==
694694
alloc_info.val.get_laddr());

src/crimson/os/seastore/linked_tree_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ class ParentNode {
417417
iter, t.add_transactional_view<copy_dests_t>(t));
418418
}
419419
auto &copy_dests = static_cast<copy_dests_t&>(*iter);
420-
auto [it, inserted] = copy_dests.dests_by_key.insert(dest);
420+
[[maybe_unused]] auto [it, inserted] =
421+
copy_dests.dests_by_key.insert(dest);
421422
assert(inserted || it->get() == dest.get());
422423
}
423424

src/crimson/os/seastore/omap_manager/btree/omap_btree_node_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ OMapInnerNode::list(
293293
}
294294
}
295295
if (child_result.size() && last && iter == liter - 1) {
296-
auto biter = --(child_result.end());
296+
[[maybe_unused]] auto biter = --(child_result.end());
297297
if (config.last_inclusive) {
298298
assert(biter->first <= *last);
299299
} else {

src/crimson/osd/pg_map.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ seastar::future<core_id_t> PGShardMapping::get_or_create_pg_mapping(
7373
}
7474
ceph_assert_always(primary_mapping.core_to_num_pgs.end() != count_iter);
7575
++(count_iter->second);
76-
auto [insert_iter, inserted] =
76+
[[maybe_unused]] auto [insert_iter, inserted] =
7777
primary_mapping.pg_to_core.emplace(pgid, core_to_update);
7878
assert(inserted);
7979
DEBUG("mapping pg {} to core {} (primary): num_pgs {}",
@@ -86,7 +86,7 @@ seastar::future<core_id_t> PGShardMapping::get_or_create_pg_mapping(
8686
if (find_iter == other_mapping.pg_to_core.end()) {
8787
DEBUG("mapping pg {} to core {} (others)",
8888
pgid, core_to_update);
89-
auto [insert_iter, inserted] =
89+
[[maybe_unused]] auto [insert_iter, inserted] =
9090
other_mapping.pg_to_core.emplace(pgid, core_to_update);
9191
assert(inserted);
9292
} else {

src/crimson/osd/pg_recovery.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ PGRecovery::on_local_recover(
409409
[soid, &recovery_info, is_delete, &t, this] {
410410
if (soid.is_snap()) {
411411
OSDriver::OSTransaction _t(pg->get_osdriver().get_transaction(&t));
412-
int r = pg->get_snap_mapper().remove_oid(soid, &_t);
412+
[[maybe_unused]] int r = pg->get_snap_mapper().remove_oid(soid, &_t);
413413
assert(r == 0 || r == -ENOENT);
414414

415415
if (!is_delete) {

0 commit comments

Comments
 (0)