From: Ronen Friedman Date: Thu, 17 Dec 2020 12:13:51 +0000 (+0000) Subject: crimson/seastore: fixing Clang errors and warnings X-Git-Tag: v16.1.0~210^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4a0f1d620e699efbd47f570110f8b9508bb8959;p=ceph.git crimson/seastore: fixing Clang errors and warnings Errors: capturing structured-binding "special ref" Warnings: unused captures Signed-off-by: Ronen Friedman --- diff --git a/src/crimson/os/seastore/journal.cc b/src/crimson/os/seastore/journal.cc index 80d6de842c8d..39875fb56379 100644 --- a/src/crimson/os/seastore/journal.cc +++ b/src/crimson/os/seastore/journal.cc @@ -666,7 +666,7 @@ Journal::scan_valid_records_ret Journal::scan_valid_records( return [=, &handler, &cursor, &budget_used] { if (!cursor.last_valid_header_found) { return read_validate_record_metadata(cursor.offset, nonce - ).safe_then([=, &cursor, &handler](auto md) { + ).safe_then([=, &cursor](auto md) { logger().debug( "Journal::scan_valid_records: read complete {}", cursor.offset); diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc b/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc index e1e73f69dd7a..1b48450b817b 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc @@ -191,6 +191,8 @@ node_future> Node::load_root(context_t c, RootNodeTracker& root_tracke &root_tracker](auto root) mutable { assert(root->impl->field_type() == field_type_t::N0); root->as_root(std::move(_super)); + std::ignore = c; // as only used in an assert + std::ignore = root_tracker; assert(root == root_tracker.get_root(c.t)); return node_ertr::make_ready_future>(root); }); @@ -309,7 +311,7 @@ node_future<> InternalNode::apply_child_split( return InternalNode::allocate( c, impl->field_type(), impl->is_level_tail(), impl->level()); }).safe_then([this_ref, this, c, left_key, left_child, right_child, - insert_pos, insert_stage, insert_size](auto fresh_right) mutable { + insert_pos, insert_stage=insert_stage, insert_size=insert_size](auto fresh_right) mutable { auto right_node = fresh_right.node; auto left_child_addr = left_child->impl->laddr(); auto left_child_addr_packed = laddr_packed_t{left_child_addr}; @@ -472,6 +474,8 @@ node_future> InternalNode::get_or_track_child( ).safe_then([this_ref, this, position, child_addr] (auto child) { assert(child_addr == child->impl->laddr()); assert(position == child->parent_info().position); + std::ignore = position; + std::ignore = child_addr; validate_child(*child); return child; }); @@ -683,8 +687,8 @@ node_future> LeafNode::insert_value( return (is_root() ? upgrade_root(c) : node_ertr::now() ).safe_then([this, c] { return LeafNode::allocate(c, impl->field_type(), impl->is_level_tail()); - }).safe_then([this_ref, this, c, &key, &value, &history, - insert_pos, insert_stage, insert_size](auto fresh_right) mutable { + }).safe_then([this_ref, this, c, &key, &value, + insert_pos, insert_stage=insert_stage, insert_size=insert_size](auto fresh_right) mutable { auto right_node = fresh_right.node; // no need to bump version for right node, as it is fresh on_layout_change(); diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h index 9f69d10adcf9..99e75791260c 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h @@ -83,6 +83,8 @@ class SeastoreNodeExtentManager final: public NodeExtentManager { e->get_length(), e->get_laddr()); assert(e->get_laddr() == addr); assert(e->get_length() == len); + std::ignore = addr; + std::ignore = len; return NodeExtentRef(e); }); } @@ -95,6 +97,7 @@ class SeastoreNodeExtentManager final: public NodeExtentManager { logger().debug("OTree::Seastore: allocated {}B at {:#x}", extent->get_length(), extent->get_laddr()); assert(extent->get_length() == len); + std::ignore = len; return NodeExtentRef(extent); }); } diff --git a/src/crimson/os/seastore/segment_manager/block.cc b/src/crimson/os/seastore/segment_manager/block.cc index 6b74fc62f848..6a4991d42082 100644 --- a/src/crimson/os/seastore/segment_manager/block.cc +++ b/src/crimson/os/seastore/segment_manager/block.cc @@ -36,7 +36,7 @@ static write_ertr::future<> do_write( "do_write: dma_write got error {}", e); return crimson::ct_error::input_output_error::make(); - }).then([&device, length=bptr.length()](auto result) + }).then([length=bptr.length()](auto result) -> write_ertr::future<> { if (result != length) { return crimson::ct_error::input_output_error::make(); diff --git a/src/crimson/tools/store-nbd.cc b/src/crimson/tools/store-nbd.cc index c4e528ed7c5a..cdf853d15c1a 100644 --- a/src/crimson/tools/store-nbd.cc +++ b/src/crimson/tools/store-nbd.cc @@ -503,7 +503,7 @@ public: tm->create_transaction(), [this, offset, size](auto &t) { return tm->read_extents(*t, offset, size - ).safe_then([=, &t](auto ext_list) mutable { + ).safe_then([=](auto ext_list) mutable { size_t cur = offset; bufferlist bl; for (auto &i: ext_list) {