Merge pull request #32494 from ronen-fr/clang_3

crimson: fix lambda captures of non-variables

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-01-07 20:45:40 +08:00 committed by GitHub
commit d063674c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View File

@ -134,7 +134,8 @@ int main(int argc, char* argv[])
using crimson::common::sharded_conf;
using crimson::common::sharded_perf_coll;
try {
return app.run_deprecated(app_args.size(), const_cast<char**>(app_args.data()), [&] {
return app.run_deprecated(app_args.size(), const_cast<char**>(app_args.data()),
[&, &ceph_args=ceph_args] {
auto& config = app.configuration();
return seastar::async([&] {
if (config.count("debug")) {

View File

@ -683,7 +683,7 @@ PG::get_locked_obc(
auto &[head_obc, head_existed] = p;
if (oid.is_head()) {
if (head_existed) {
return head_obc->get_lock_type(op, type).then([head_obc] {
return head_obc->get_lock_type(op, type).then([head_obc=head_obc] {
ceph_assert(head_obc->loaded);
return load_obc_ertr::make_ready_future<ObjectContextRef>(head_obc);
});
@ -693,14 +693,14 @@ PG::get_locked_obc(
}
} else {
return head_obc->get_lock_type(op, RWState::RWREAD).then(
[this, head_obc, op, oid, type] {
[this, head_obc=head_obc, op, oid, type] {
ceph_assert(head_obc->loaded);
return get_or_load_clone_obc(oid, head_obc);
}).safe_then([this, head_obc, op, oid, type](auto p) {
}).safe_then([this, head_obc=head_obc, op, oid, type](auto p) {
auto &[obc, existed] = p;
if (existed) {
return load_obc_ertr::future<>(
obc->get_lock_type(op, type)).safe_then([obc] {
obc->get_lock_type(op, type)).safe_then([obc=obc] {
ceph_assert(obc->loaded);
return load_obc_ertr::make_ready_future<ObjectContextRef>(obc);
});
@ -708,7 +708,7 @@ PG::get_locked_obc(
obc->degrade_excl_to(type);
return load_obc_ertr::make_ready_future<ObjectContextRef>(obc);
}
}).safe_then([head_obc](auto obc) {
}).safe_then([head_obc=head_obc](auto obc) {
head_obc->put_lock_type(RWState::RWREAD);
return load_obc_ertr::make_ready_future<ObjectContextRef>(obc);
});

View File

@ -467,8 +467,8 @@ public:
F &&f) {
auto [oid, type] = get_oid_and_lock(*m, op_info);
return get_locked_obc(op, oid, type)
.safe_then([this, f=std::forward<F>(f), type](auto obc) {
return f(obc).finally([this, obc, type] {
.safe_then([this, f=std::forward<F>(f), type=type](auto obc) {
return f(obc).finally([this, obc, type=type] {
obc->put_lock_type(type);
return load_obc_ertr::now();
});

View File

@ -81,7 +81,8 @@ seastar::future<> ShardServices::dispatch_context_messages(
[this](auto& osd_messages) {
auto& [peer, messages] = osd_messages;
logger().debug("dispatch_context_messages sending messages to {}", peer);
return seastar::parallel_for_each(std::move(messages), [=](auto& m) {
return seastar::parallel_for_each(
std::move(messages), [=, peer=peer](auto& m) {
return send_to_osd(peer, m, osdmap->get_epoch());
});
});