]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: move lookup() of SharedBlobSet back into .h
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 22 Sep 2016 03:26:48 +0000 (11:26 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 22 Sep 2016 06:49:03 +0000 (14:49 +0800)
Because the lookup() method is simple and easy,
and requires no dout for debugging.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index ee4f3eb55d284301bc330fdc1cc819d4dfb368d3..adc6e843d8cf11a9e1706c27ebaa1c96e082f897 100644 (file)
@@ -1208,24 +1208,6 @@ void BlueStore::SharedBlob::put()
   }
 }
 
-
-// SharedBlobSet
-
-#undef dout_prefix
-#define dout_prefix *_dout << "bluestore.sharedblobset(" << this << ") "
-
-BlueStore::SharedBlobRef BlueStore::SharedBlobSet::lookup(uint64_t sbid)
-{
-  std::lock_guard<std::mutex> l(lock);
-  dummy.sbid = sbid;
-  auto p = uset.find(dummy);
-  if (p == uset.end()) {
-    return nullptr;
-  }
-  return &*p;
-}
-
-
 // Blob
 
 #undef dout_prefix
index a734c023d7beba00d90af88e1ea7caff9c8760f1..9222f4699d82be07af560f0edd7ab2833e145878 100644 (file)
@@ -357,7 +357,15 @@ public:
       assert(n > 0);
     }
 
-    SharedBlobRef lookup(uint64_t sbid);
+    SharedBlobRef lookup(uint64_t sbid) {
+      std::lock_guard<std::mutex> l(lock);
+      dummy.sbid = sbid;
+      auto p = uset.find(dummy);
+      if (p == uset.end()) {
+        return nullptr;
+      }
+      return &*p;
+    }
 
     void add(SharedBlob *sb) {
       std::lock_guard<std::mutex> l(lock);