summaryrefslogtreecommitdiff
path: root/src/ceph_osd.cc
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-11-29 21:06:29 -0800
committerSage Weil <sage@newdream.net>2011-12-19 08:12:11 -0800
commitc59eb8ca33a415d5afdd4585b69c979766cc0942 (patch)
tree00b651729eec0373ecc4b7697a68054f15439d67 /src/ceph_osd.cc
parenta582209517c7aa1d6e4cf32a3c5ccb461f437434 (diff)
downloadceph-c59eb8ca33a415d5afdd4585b69c979766cc0942.tar.gz
osd: --get-osd-fsid and --get-cluster-fsid
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/ceph_osd.cc')
-rw-r--r--src/ceph_osd.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc
index c51b6824444..a12a73367e4 100644
--- a/src/ceph_osd.cc
+++ b/src/ceph_osd.cc
@@ -65,6 +65,8 @@ int main(int argc, const char **argv)
bool mkkey = false;
bool flushjournal = false;
bool convertfilestore = false;
+ bool get_osd_fsid = false;
+ bool get_cluster_fsid = false;
std::string dump_pg_log;
std::string val;
@@ -86,6 +88,10 @@ int main(int argc, const char **argv)
convertfilestore = true;
} else if (ceph_argparse_witharg(args, i, &val, "--dump-pg-log", (char*)NULL)) {
dump_pg_log = val;
+ } else if (ceph_argparse_flag(args, i, "--get-cluster-fsid", (char*)NULL)) {
+ get_cluster_fsid = true;
+ } else if (ceph_argparse_flag(args, i, "--get-osd-fsid", (char*)NULL)) {
+ get_osd_fsid = true;
} else {
++i;
}
@@ -213,9 +219,9 @@ int main(int argc, const char **argv)
}
string magic;
- uuid_d fsid;
+ uuid_d cluster_fsid, osd_fsid;
int w;
- int r = OSD::peek_meta(g_conf->osd_data, magic, fsid, w);
+ int r = OSD::peek_meta(g_conf->osd_data, magic, cluster_fsid, osd_fsid, w);
if (r < 0) {
derr << TEXT_RED << " ** ERROR: unable to open OSD superblock on "
<< g_conf->osd_data << ": " << cpp_strerror(-r)
@@ -236,6 +242,15 @@ int main(int argc, const char **argv)
exit(1);
}
+ if (get_cluster_fsid) {
+ cout << cluster_fsid << std::endl;
+ exit(0);
+ }
+ if (get_osd_fsid) {
+ cout << osd_fsid << std::endl;
+ exit(0);
+ }
+
pick_addresses(g_ceph_context);
if (g_conf->public_addr.is_blank_ip() && !g_conf->cluster_addr.is_blank_ip()) {
@@ -262,7 +277,7 @@ int main(int argc, const char **argv)
global_print_banner();
cout << "starting osd." << whoami
- << " at " << client_messenger->get_ms_addr()
+ << " at " << client_messenger->get_ms_addr()
<< " osd_data " << g_conf->osd_data
<< " " << ((g_conf->osd_journal.empty()) ?
"(no journal)" : g_conf->osd_journal)