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);
}
+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)
{
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;
*/
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()
*
#include "common/version.h"
#include "os/ObjectStore.h"
-#include "os/FileJournal.h"
#include "ReplicatedPG.h"
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)
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