]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: move peek_journal_fsid() into ObjectStore (from OSD)
authorSage Weil <sage@inktank.com>
Sun, 3 Nov 2013 02:29:11 +0000 (19:29 -0700)
committerSage Weil <sage@inktank.com>
Sat, 30 Nov 2013 06:28:36 +0000 (22:28 -0800)
This kills the last FileJournal reference in the OSD!

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

index aeb7980d9f9291c9fd95abcededa72115d934d22..fa87a811610d22138574ab89abfc35531b639e47 100644 (file)
@@ -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);
index 89a55b393db7cfa872ca2b69ea27ae8fd1b30d92..b96ead7fbd85775388b6d68c6e240a34dbe57a97 100644 (file)
@@ -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)
 {
index 0a215253c58c64b6b14732f2293ad31ece5ab8da..ab7e47f6fefcf56fb124e7fdf9df8fbfad30ec23 100644 (file)
@@ -103,6 +103,8 @@ public:
     return target_version;
   }
 
+  int peek_journal_fsid(uuid_d *fsid);
+
   struct FSPerfTracker {
     PerfCounters::avg_tracker<uint64_t> os_commit_latency;
     PerfCounters::avg_tracker<uint64_t> os_apply_latency;
index 0392e15ab37508475d19a42fc13f21045af2d4b3..bd11b1482cbb8b64cfb8fe21283283c404d07c55 100644 (file)
@@ -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()
    *
index 821a3ab7eb69fb4bc99c8988585b6db5a952f12b..042550cd8518e08d8bb7992a503445f6dcf65d33 100644 (file)
@@ -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)
index 0280e5ad219e8516e9920bc74950cc2a2f3ed743..4ea54fc4aa4e0de790a7d8b54b9001fbd4621178 100644 (file)
@@ -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