From: Sage Weil Date: Sun, 3 Nov 2013 02:29:11 +0000 (-0700) Subject: osd: move peek_journal_fsid() into ObjectStore (from OSD) X-Git-Tag: v0.74~43^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bb42a0c4416d0a7ce0b608ab9ea82674d2f5aba;p=ceph.git osd: move peek_journal_fsid() into ObjectStore (from OSD) This kills the last FileJournal reference in the OSD! Signed-off-by: Sage Weil --- diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index aeb7980d9f92..fa87a811610d 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -279,7 +279,7 @@ int main(int argc, const char **argv) if (get_journal_fsid) { uuid_d fsid; - int r = OSD::peek_journal_fsid(g_conf->osd_journal, fsid); + int r = store->peek_journal_fsid(&fsid); if (r == 0) cout << fsid << std::endl; exit(r); diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 89a55b393db7..b96ead7fbd85 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -104,6 +104,15 @@ static CompatSet get_fs_supported_compat_set() { } +int FileStore::peek_journal_fsid(uuid_d *fsid) +{ + // make sure we don't try to use aio or direct_io (and get annoying + // error messages from failing to do so); performance implications + // should be irrelevant for this use + FileJournal j(*fsid, 0, 0, journalpath.c_str(), false, false); + return j.peek_fsid(*fsid); +} + void FileStore::FSPerfTracker::update_from_perfcounters( PerfCounters &logger) { diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 0a215253c58c..ab7e47f6fefc 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -103,6 +103,8 @@ public: return target_version; } + int peek_journal_fsid(uuid_d *fsid); + struct FSPerfTracker { PerfCounters::avg_tracker os_commit_latency; PerfCounters::avg_tracker os_apply_latency; diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 0392e15ab375..bd11b1482cbb 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -879,6 +879,11 @@ public: */ virtual uint32_t get_target_version() = 0; + /** + * check the journal uuid/fsid, without opening + */ + virtual int peek_journal_fsid(uuid_d *fsid) = 0; + /** * get ideal min value for collection_list_partial() * diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 821a3ab7eb69..042550cd8518 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -39,7 +39,6 @@ #include "common/version.h" #include "os/ObjectStore.h" -#include "os/FileJournal.h" #include "ReplicatedPG.h" @@ -757,15 +756,6 @@ int OSD::peek_meta(const std::string &dev, std::string& magic, return 0; } -int OSD::peek_journal_fsid(string path, uuid_d& fsid) -{ - // make sure we don't try to use aio or direct_io (and get annoying - // error messages from failing to do so); performance implications - // should be irrelevant for this use - FileJournal j(fsid, 0, 0, path.c_str(), false, false); - return j.peek_fsid(fsid); -} - #undef dout_prefix #define dout_prefix _prefix(_dout, whoami, osdmap) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 0280e5ad219e..4ea54fc4aa4e 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1743,7 +1743,6 @@ private: public: static int peek_meta(const std::string &dev, string& magic, uuid_d& cluster_fsid, uuid_d& osd_fsid, int& whoami); - static int peek_journal_fsid(std::string jpath, uuid_d& fsid); // startup/shutdown