]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os: export compact interface in ObjectStore and ObjectMap
authorliuchang0812 <liuchang0812@gmail.com>
Fri, 30 Jun 2017 08:50:53 +0000 (16:50 +0800)
committerVikhyat Umrao <vumrao@redhat.com>
Mon, 9 Oct 2017 14:27:06 +0000 (10:27 -0400)
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
(cherry picked from commit eb5723d3abd4e1b6caec477090761d7919efc7bd)

 Conflicts:
src/os/bluestore/BlueStore.h
         Removed declarations which are not part of this backport
          inject_data_error()
          inject_mdata_error()
          debug_data_eio()
          debug_mdata_eio()
          debug_oj_on_delete()
src/os/filestore/FileStore.h
         Removed declarations which are not part of this backport
          set<ghobject_t> data_error_set
          set<ghobject_t> mdata_error_set
          inject_data_error() override
          inject_mdata_error() override

src/os/ObjectMap.h
src/os/ObjectStore.h
src/os/bluestore/BlueStore.h
src/os/filestore/DBObjectMap.h
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h
src/os/kstore/KStore.h

index 95ca9a5b0553cfb1468a1315910dbd95f5329fdb..8f8397c8a05d9bcca86527d8be79ac73d000c737 100644 (file)
@@ -153,6 +153,8 @@ public:
 
   virtual int check(std::ostream &out, bool repair = false) { return 0; }
 
+  virtual void compact() {}
+
   typedef KeyValueDB::GenericIteratorImpl ObjectMapIteratorImpl;
   typedef ceph::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
   virtual ObjectMapIterator get_iterator(const ghobject_t &oid) {
index ae0584da3aac479a9d8564af064840e583f1fc64..61b50ebe666429f68facced0c0a59a69afd62892 100644 (file)
@@ -2411,6 +2411,8 @@ public:
   // DEBUG
   virtual void inject_data_error(const ghobject_t &oid) {}
   virtual void inject_mdata_error(const ghobject_t &oid) {}
+
+  virtual void compact() {}
 };
 WRITE_CLASS_ENCODER(ObjectStore::Transaction)
 WRITE_CLASS_ENCODER(ObjectStore::Transaction::TransactionData)
index 91aec621603bc71d6e2e71dd8a008e5d07aecd23..c2c577fbd08035b8ecb957f8f79985941b612b83 100644 (file)
@@ -840,6 +840,11 @@ public:
     TrackedOpRef op = TrackedOpRef(),
     ThreadPool::TPHandle *handle = NULL) override;
 
+  void compact() override {
+    assert(db);
+    db->compact();
+  }
+  
 private:
   // --------------------------------------------------------
   // write ops
index 3f64802a42ed8aaf9385034393717a636c871252..d9a5a2998ceb02c214ec03ce2f8e94396c99c823 100644 (file)
@@ -229,6 +229,11 @@ public:
   /// Ensure that all previous operations are durable
   int sync(const ghobject_t *oid=0, const SequencerPosition *spos=0);
 
+  void compact() override {
+    assert(db);
+    db->compact();
+  }
+
   /// Util, get all objects, there must be no other concurrent access
   int list_objects(vector<ghobject_t> *objs ///< [out] objects
     );
index 58d90e0889c724a4352b1e1c5ad1172e3f70f074..238f2ed6139f7af4a1d76f03a0fe877d29f97e38 100644 (file)
@@ -4117,6 +4117,7 @@ void FileStore::inject_mdata_error(const ghobject_t &oid) {
   dout(10) << __func__ << ": init error on " << oid << dendl;
   mdata_error_set.insert(oid);
 }
+
 void FileStore::debug_obj_on_delete(const ghobject_t &oid) {
   Mutex::Locker l(read_error_lock);
   dout(10) << __func__ << ": clear error on " << oid << dendl;
index 9d3f9c85a4e8a87f846f880ffe318f9f49a1b171..7d792c499275d9903e67494bff5411717631f6b0 100644 (file)
@@ -595,6 +595,12 @@ public:
   set<ghobject_t, ghobject_t::BitwiseComparator> mdata_error_set; // getattr(),stat() will return -EIO
   void inject_data_error(const ghobject_t &oid);
   void inject_mdata_error(const ghobject_t &oid);
+
+  void compact() override {
+    assert(object_map);
+    object_map->compact();
+  }
+
   void debug_obj_on_delete(const ghobject_t &oid);
   bool debug_data_eio(const ghobject_t &oid);
   bool debug_mdata_eio(const ghobject_t &oid);
index 09483de46be6d1e75a85644047e065dd467f03ca..c27df7e788cfb7304261d65ad055f3baf9e1a509 100644 (file)
@@ -532,6 +532,11 @@ public:
     TrackedOpRef op = TrackedOpRef(),
     ThreadPool::TPHandle *handle = NULL);
 
+  void compact () override {
+    assert(db);
+    db->compact();
+  }
+  
 private:
   // --------------------------------------------------------
   // write ops