From: Yunchuan Wen Date: Tue, 4 Aug 2015 09:10:01 +0000 (+0000) Subject: add agent_start/finish_evict_op to control agent_ops X-Git-Tag: v9.1.0~200^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=caf98c83d2c42dce5c38c1c984076830df970c75;p=ceph.git add agent_start/finish_evict_op to control agent_ops Signed-off-by: Yunchuan Wen Reviewed-by: Li Wang Reviewed-by: Mingxin Liu --- diff --git a/src/osd/OSD.h b/src/osd/OSD.h index a5d429fabb44..3cb62c348119 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);