]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove lock for removed_collections. 18785/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 17 Nov 2017 10:14:37 +0000 (18:14 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 17 Nov 2017 10:14:59 +0000 (18:14 +0800)
Current, queue removed-collections and handle removed-collections
in the same thread. So no need a lock to protect.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index cd4513be7c4ca4739e2eba7cf9152c08483dfa8b..fc75f36e1f9b4e83aa9c8b7e91f08afdbaf745a4 100644 (file)
@@ -6294,7 +6294,8 @@ BlueStore::CollectionRef BlueStore::_get_collection(const coll_t& cid)
 void BlueStore::_queue_reap_collection(CollectionRef& c)
 {
   dout(10) << __func__ << " " << c << " " << c->cid << dendl;
-  std::lock_guard<std::mutex> l(reap_lock);
+  // _reap_collections and this in the same thread,
+  // so no need a lock.
   removed_collections.push_back(c);
 }
 
@@ -6303,7 +6304,8 @@ void BlueStore::_reap_collections()
 
   list<CollectionRef> removed_colls;
   {
-    std::lock_guard<std::mutex> l(reap_lock);
+    // _queue_reap_collection and this in the same thread.
+    // So no need a lock.
     if (!removed_collections.empty())
       removed_colls.swap(removed_collections);
     else
@@ -6333,7 +6335,6 @@ void BlueStore::_reap_collections()
   if (removed_colls.empty()) {
     dout(10) << __func__ << " all reaped" << dendl;
   } else {
-    std::lock_guard<std::mutex> l(reap_lock);
     removed_collections.splice(removed_collections.begin(), removed_colls);
   }
 }
index 39a9607743a8cabdff61ece058f6adeeeec0b170..f76308d8c422e3e9749f2ef037a0095d4342140e 100644 (file)
@@ -1883,7 +1883,6 @@ private:
 
   PerfCounters *logger = nullptr;
 
-  std::mutex reap_lock;
   list<CollectionRef> removed_collections;
 
   RWLock debug_read_error_lock = {"BlueStore::debug_read_error_lock"};