From 4f18781241844253be1e4fda33ff962b4a31eae8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 18 Nov 2020 18:03:55 +0800 Subject: [PATCH] crimson/os: do not capture unused variables silences warnings reported by clang iike: btree_lba_manager.cc:439:50: warning: lambda capture 't' is not used [-Wunused-lambda-capture] lba_node->get_node_meta().depth).safe_then([=, &t](LBANodeRef c) { ~~~^ 1 warning generated. Signed-off-by: Kefu Chai --- src/crimson/os/seastore/journal.cc | 7 +++---- .../os/seastore/lba_manager/btree/btree_lba_manager.cc | 2 +- src/crimson/os/seastore/transaction_manager.cc | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/crimson/os/seastore/journal.cc b/src/crimson/os/seastore/journal.cc index 7b228445a32be..a991d669a1400 100644 --- a/src/crimson/os/seastore/journal.cc +++ b/src/crimson/os/seastore/journal.cc @@ -157,8 +157,7 @@ Journal::roll_journal_segment() return (current_journal_segment ? current_journal_segment->close() : - Segment::close_ertr::now()).safe_then( - [this, old_segment_id] { + Segment::close_ertr::now()).safe_then([this] { return segment_provider->get_segment(); }).safe_then([this](auto segment) { return segment_manager.open(segment); @@ -508,7 +507,7 @@ Journal::scan_segment_ret Journal::scan_segment( [=, ¤t](auto &header, auto &bl) { return scan_segment_ertr::now( ).safe_then( - [=, ¤t, &header, &bl]() + [=, &header, &bl]() -> scan_segment_ertr::future<> { if (!delta_handler) { return scan_segment_ertr::now(); @@ -579,7 +578,7 @@ Journal::scan_segment_ret Journal::scan_segment( } }); }); - }).safe_then([this, ¤t] { + }).safe_then([¤t] { return scan_segment_ertr::make_ready_future(current); }); }); diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc index 3642f76b37a05..7035601807855 100644 --- a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc +++ b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc @@ -436,7 +436,7 @@ BtreeLBAManager::get_physical_extent_if_live( return root->lookup( op_context_t{cache, pin_set, t}, lba_node->get_node_meta().begin, - lba_node->get_node_meta().depth).safe_then([=, &t](LBANodeRef c) { + lba_node->get_node_meta().depth).safe_then([=](LBANodeRef c) { if (c->get_paddr() == lba_node->get_paddr()) { return get_physical_extent_if_live_ret( get_physical_extent_if_live_ertr::ready_future_marker{}, diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index d8b543d2dfde3..7b86631e2ca7c 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -272,7 +272,7 @@ TransactionManager::get_extent_if_live_ret TransactionManager::get_extent_if_liv addr, laddr, len).safe_then( - [this, &t, pin=std::move(pin)](CachedExtentRef ret) mutable { + [this, pin=std::move(pin)](CachedExtentRef ret) mutable { auto lref = ret->cast(); if (!lref->has_pin()) { lref->set_pin(std::move(pin)); -- 2.39.5