From caf98c83d2c42dce5c38c1c984076830df970c75 Mon Sep 17 00:00:00 2001 From: Yunchuan Wen Date: Tue, 4 Aug 2015 09:10:01 +0000 Subject: [PATCH] add agent_start/finish_evict_op to control agent_ops Signed-off-by: Yunchuan Wen Reviewed-by: Li Wang Reviewed-by: Mingxin Liu --- src/osd/OSD.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index a5d429fabb4..3cb62c34811 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -708,6 +708,20 @@ public: _dequeue(pg, old_priority); } + /// note start of an async (evict) op + void agent_start_evict_op() { + Mutex::Locker l(agent_lock); + ++agent_ops; + } + + /// note finish or cancellation of an async (evict) op + void agent_finish_evict_op() { + Mutex::Locker l(agent_lock); + assert(agent_ops > 0); + --agent_ops; + agent_cond.Signal(); + } + /// note start of an async (flush) op void agent_start_op(const hobject_t& oid) { Mutex::Locker l(agent_lock); -- 2.47.3