]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/ObjectStore: generalize the FileStore's target_version
authorSage Weil <sage@inktank.com>
Sun, 3 Nov 2013 02:23:06 +0000 (19:23 -0700)
committerSage Weil <sage@inktank.com>
Sat, 30 Nov 2013 06:28:36 +0000 (22:28 -0800)
This kills the last FileStore reference in the OSD.

Signed-off-by: Sage Weil <sage@inktank.com>
src/ceph_osd.cc
src/os/FileStore.h
src/os/ObjectStore.h

index 83035c8ffd737fc86dda7a58d651628f5d1318c2..aeb7980d9f9291c9fd95abcededa72115d934d22 100644 (file)
@@ -23,7 +23,7 @@
 using namespace std;
 
 #include "osd/OSD.h"
-#include "os/FileStore.h"
+#include "os/ObjectStore.h"
 #include "mon/MonClient.h"
 #include "include/ceph_features.h"
 
@@ -435,7 +435,7 @@ int main(int argc, const char **argv)
   global_init_daemonize(g_ceph_context, 0);
   common_init_finish(g_ceph_context);
 
-  if (g_conf->filestore_update_to >= (int)FileStore::target_version) {
+  if (g_conf->filestore_update_to >= (int)store->get_target_version()) {
     int err = OSD::do_convertfs(store);
     if (err < 0) {
       derr << TEXT_RED << " ** ERROR: error converting store " << g_conf->osd_data
index c489fdd57960900b6aa4be5544f3da36c20ef877..0a215253c58c64b6b14732f2293ad31ece5ab8da 100644 (file)
@@ -97,7 +97,11 @@ inline ostream& operator<<(ostream& out, const FSSuperblock& sb)
 class FileStore : public JournalingObjectStore,
                   public md_config_obs_t
 {
+  static const uint32_t target_version = 3;
 public:
+  uint32_t get_target_version() {
+    return target_version;
+  }
 
   struct FSPerfTracker {
     PerfCounters::avg_tracker<uint64_t> os_commit_latency;
@@ -117,7 +121,6 @@ public:
     return perf_tracker.get_cur_stats();
   }
 
-  static const uint32_t target_version = 3;
 private:
   string internal_name;         ///< internal name, used to name the perfcounter instance
   string basedir, journalpath;
index 12565522414c069b678cb3879f55f415915c690b..0392e15ab37508475d19a42fc13f21045af2d4b3 100644 (file)
@@ -874,6 +874,11 @@ public:
 
   virtual int statfs(struct statfs *buf) = 0;
 
+  /**
+   * get the most recent "on-disk format version" supported
+   */
+  virtual uint32_t get_target_version() = 0;
+
   /**
    * get ideal min value for collection_list_partial()
    *