]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/seastore: fixing Clang errors and warnings 38635/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 17 Dec 2020 12:13:51 +0000 (12:13 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 17 Dec 2020 12:18:37 +0000 (12:18 +0000)
Errors: capturing structured-binding "special ref"

Warnings: unused captures

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/crimson/os/seastore/journal.cc
src/crimson/os/seastore/onode_manager/staged-fltree/node.cc
src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h
src/crimson/os/seastore/segment_manager/block.cc
src/crimson/tools/store-nbd.cc

index 80d6de842c8d4ee49ee54b9e0e56cf451876b5a8..39875fb563798a1d83504116906924595810220b 100644 (file)
@@ -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);
index e1e73f69dd7a870f6eedc62644d8e8c8318376f6..1b48450b817b6dcc91b6f187f23f7bb4e17a1cb3 100644 (file)
@@ -191,6 +191,8 @@ node_future<Ref<Node>> 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<Ref<Node>>(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_stageinsert_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<Ref<Node>> 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<Ref<tree_cursor_t>> 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_stageinsert_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();
index 9f69d10adcf9c316ec40876887255f6894249fbc..99e75791260ca2c26bf8b153e7d3584252489882 100644 (file)
@@ -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);
     });
   }
index 6b74fc62f848a0592d7823ec707b9826671dcc34..6a4991d42082f18453fd4aa904028cfa4be0fd05 100644 (file)
@@ -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();
index c4e528ed7c5a2e8a1fe31e6ae3166e5dd6deb40a..cdf853d15c1a3e3fe6f34215caea76d2bdd4214d 100644 (file)
@@ -503,7 +503,7 @@ public:
       tm->create_transaction(),
       [this, offset, size](auto &t) {
        return tm->read_extents<TestBlock>(*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) {