From 27e7ddf9b5f29845d18753ba68b14ac098d28e49 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 19 Apr 2022 11:21:05 +0200 Subject: [PATCH] librbd/cache/pwl: fix -Wunused-lambda-capture warnings Reported by clang on "make check" and "make check arm64" builds. Signed-off-by: Ilya Dryomov (cherry picked from commit 753aa038fdbc26a2ee0978f54d3f7dcfa052e833) --- src/librbd/cache/pwl/AbstractWriteLog.cc | 6 +++--- src/librbd/cache/pwl/Request.cc | 2 +- src/librbd/cache/pwl/ssd/LogOperation.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librbd/cache/pwl/AbstractWriteLog.cc b/src/librbd/cache/pwl/AbstractWriteLog.cc index b11d947d34fec..b0d9cdedd30ec 100644 --- a/src/librbd/cache/pwl/AbstractWriteLog.cc +++ b/src/librbd/cache/pwl/AbstractWriteLog.cc @@ -1394,7 +1394,7 @@ void AbstractWriteLog::dispatch_deferred_writes(void) if (allocated_req && front_req && allocated) { /* Push dispatch of the first allocated req to a wq */ m_work_queue.queue(new LambdaContext( - [this, allocated_req](int r) { + [allocated_req](int r) { allocated_req->dispatch(); }), 0); allocated_req = nullptr; @@ -1873,7 +1873,7 @@ void AbstractWriteLog::new_sync_point(DeferredContexts &later) { /* This sync point will acquire no more sub-ops. Activation needs * to acquire m_lock, so defer to later*/ later.add(new LambdaContext( - [this, old_sync_point](int r) { + [old_sync_point](int r) { old_sync_point->prior_persisted_gather_activate(); })); } @@ -1930,7 +1930,7 @@ void AbstractWriteLog::flush_new_sync_point(C_FlushRequestT *flush_req, * now has its finisher. If the sub is already complete, activation will * complete the Gather. The finisher will acquire m_lock, so we'll activate * this when we release m_lock.*/ - later.add(new LambdaContext([this, to_append](int r) { + later.add(new LambdaContext([to_append](int r) { to_append->persist_gather_activate(); })); diff --git a/src/librbd/cache/pwl/Request.cc b/src/librbd/cache/pwl/Request.cc index c5dea8c8399df..96333192527ff 100644 --- a/src/librbd/cache/pwl/Request.cc +++ b/src/librbd/cache/pwl/Request.cc @@ -251,7 +251,7 @@ bool C_WriteRequest::append_write_request(std::shared_ptr sync_poi std::lock_guard locker(m_lock); auto write_req_sp = this; if (sync_point->earlier_sync_point) { - Context *schedule_append_ctx = new LambdaContext([this, write_req_sp](int r) { + Context *schedule_append_ctx = new LambdaContext([write_req_sp](int r) { write_req_sp->schedule_append(); }); sync_point->earlier_sync_point->on_sync_point_appending.push_back(schedule_append_ctx); diff --git a/src/librbd/cache/pwl/ssd/LogOperation.cc b/src/librbd/cache/pwl/ssd/LogOperation.cc index f759d8a8eeec5..c8080e37d0f50 100644 --- a/src/librbd/cache/pwl/ssd/LogOperation.cc +++ b/src/librbd/cache/pwl/ssd/LogOperation.cc @@ -20,7 +20,7 @@ void DiscardLogOperation::init_op( log_entry->init(current_sync_gen, persist_on_flush, last_op_sequence_num); if (persist_on_flush) { this->on_write_append = new LambdaContext( - [this, write_persist, write_append] (int r) { + [write_persist, write_append] (int r) { write_append->complete(r); write_persist->complete(r); }); -- 2.39.5