From: Sage Weil Date: Sun, 3 Nov 2013 02:23:06 +0000 (-0700) Subject: os/ObjectStore: generalize the FileStore's target_version X-Git-Tag: v0.74~43^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf5a7b24272d1582e208a033cad885c11fedc817;p=ceph.git os/ObjectStore: generalize the FileStore's target_version This kills the last FileStore reference in the OSD. Signed-off-by: Sage Weil --- diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 83035c8ffd73..aeb7980d9f92 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -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 diff --git a/src/os/FileStore.h b/src/os/FileStore.h index c489fdd57960..0a215253c58c 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -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 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; diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 12565522414c..0392e15ab375 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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() *