]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/MemStore: move OmapIteratorImpl to cc file
authorMichal Jarzabek <stiopa@gmail.com>
Sat, 20 Aug 2016 07:38:36 +0000 (08:38 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Sun, 21 Aug 2016 12:08:40 +0000 (13:08 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/os/memstore/MemStore.cc
src/os/memstore/MemStore.h

index 908da42f0c342eabfaf9cda483e6e68509fdc6c1..c837c577afa66cf21eca697df2b0762e6533f2d8 100644 (file)
@@ -597,6 +597,51 @@ int MemStore::omap_check_keys(
   return 0;
 }
 
+class MemStore::OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
+  CollectionRef c;
+  ObjectRef o;
+  map<string,bufferlist>::iterator it;
+public:
+  OmapIteratorImpl(CollectionRef c, ObjectRef o)
+    : c(c), o(o), it(o->omap.begin()) {}
+
+  int seek_to_first() {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    it = o->omap.begin();
+    return 0;
+  }
+  int upper_bound(const string &after) {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    it = o->omap.upper_bound(after);
+    return 0;
+  }
+  int lower_bound(const string &to) {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    it = o->omap.lower_bound(to);
+    return 0;
+  }
+  bool valid() {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    return it != o->omap.end();
+  }
+  int next(bool validate=true) {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    ++it;
+    return 0;
+  }
+  string key() {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    return it->first;
+  }
+  bufferlist value() {
+    std::lock_guard<std::mutex>(o->omap_mutex);
+    return it->second;
+  }
+  int status() {
+    return 0;
+  }
+};
+
 ObjectMap::ObjectMapIterator MemStore::get_omap_iterator(const coll_t& cid,
                                                         const ghobject_t& oid)
 {
index 1759932e7fe840d7bb324bbe4eeadb98367c3df9..c29311b783155dfd9db8a72d639ff987205fc013 100644 (file)
@@ -253,50 +253,7 @@ public:
   typedef Collection::Ref CollectionRef;
 
 private:
-  class OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
-    CollectionRef c;
-    ObjectRef o;
-    map<string,bufferlist>::iterator it;
-  public:
-    OmapIteratorImpl(CollectionRef c, ObjectRef o)
-      : c(c), o(o), it(o->omap.begin()) {}
-
-    int seek_to_first() {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      it = o->omap.begin();
-      return 0;
-    }
-    int upper_bound(const string &after) {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      it = o->omap.upper_bound(after);
-      return 0;
-    }
-    int lower_bound(const string &to) {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      it = o->omap.lower_bound(to);
-      return 0;
-    }
-    bool valid() {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      return it != o->omap.end();
-    }
-    int next(bool validate=true) {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      ++it;
-      return 0;
-    }
-    string key() {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      return it->first;
-    }
-    bufferlist value() {
-      std::lock_guard<std::mutex>(o->omap_mutex);
-      return it->second;
-    }
-    int status() {
-      return 0;
-    }
-  };
+  class OmapIteratorImpl;
 
 
   ceph::unordered_map<coll_t, CollectionRef> coll_map;