]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
add agent_start/finish_evict_op to control agent_ops
authorYunchuan Wen <yunchuanwen@ubuntukylin.com>
Tue, 4 Aug 2015 09:10:01 +0000 (09:10 +0000)
committerYunchuan Wen <yunchuanwen@ubuntukylin.com>
Tue, 4 Aug 2015 09:10:01 +0000 (09:10 +0000)
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Reviewed-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Mingxin Liu <mingxinliu@ubuntukylin.com>
src/osd/OSD.h

index a5d429fabb44c2035c6fbd36c444d5d41fee9ff2..3cb62c3481192016c007e7230410607ee509c1aa 100644 (file)
@@ -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);