From: Kefu Chai Date: Wed, 11 Nov 2020 05:38:22 +0000 (+0800) Subject: crimson/osd: pass RWState using template parameter X-Git-Tag: v17.0.0~599^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6811578137e0184656447ed697b3dfeb071ce8b3;p=ceph.git crimson/osd: pass RWState using template parameter Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index 4815a28529b1c..72f271beb37f4 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -112,9 +112,9 @@ private: } public: - template - auto with_lock(RWState::State type, Func&& func) { - switch (type) { + template + auto with_lock(Func&& func) { + switch (Type) { case RWState::RWWRITE: return seastar::with_lock(lock.for_write(), std::forward(func)); case RWState::RWREAD: @@ -125,9 +125,9 @@ public: assert(0 == "noop"); } } - template - auto with_promoted_lock(RWState::State type, Func&& func) { - switch (type) { + template + auto with_promoted_lock(Func&& func) { + switch (Type) { case RWState::RWWRITE: return seastar::with_lock(lock.excl_from_write(), std::forward(func)); case RWState::RWREAD: