From: David Zafman Date: Tue, 27 Jan 2015 22:32:42 +0000 (-0800) Subject: ceph-objectstore-tool: Use empty string for to specify pgmeta object X-Git-Tag: v9.0.2~168^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c00290b836adba12212e8a57f13b0c9193ac0ef8;p=ceph.git ceph-objectstore-tool: Use empty string for to specify pgmeta object Signed-off-by: David Zafman --- diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 1f3037e33d32..6522697b90de 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -2356,6 +2356,8 @@ void usage(po::options_description &desc) cerr << "by --op list." << std::endl; cerr << " can be an object name which will be looked up in all" << std::endl; cerr << "the OSD's PGs." << std::endl; + cerr << " can be the empty string ('') which with a provided pgid " << std::endl; + cerr << "specifies the pgmeta object" << std::endl; cerr << std::endl; cerr << "The optional [file] argument will read stdin or write stdout" << std::endl; cerr << "if not specified or if '-' specified." << std::endl; @@ -2414,7 +2416,7 @@ int main(int argc, char **argv) po::options_description positional("Positional options"); positional.add_options() - ("object", po::value(&object), "object name or ghobject in json") + ("object", po::value(&object), "'' for pgmeta_oid, object name or ghobject in json") ("objcmd", po::value(&objcmd), "command [(get|set)-bytes, (get|set|rm)-(attr|omap), (get|set)-omaphdr, list-attrs, list-omap, remove]") ("arg1", po::value(&arg1), "arg1 based on cmd") ("arg2", po::value(&arg2), "arg2 based on cmd") @@ -2717,6 +2719,11 @@ int main(int argc, char **argv) } if (op != "list" && vm.count("object")) { + // Special case: Create pgmeta_oid if empty string specified + // This can't conflict with any actual object names. + if (object == "") { + ghobj = pgid.make_pgmeta_oid(); + } else { json_spirit::Value v; try { if (!json_spirit::read(object, v)) { @@ -2789,6 +2796,7 @@ int main(int argc, char **argv) ret = 1; goto out; } + } } if (op != "list" && op != "import" && op != "list-lost" && op != "fix-lost"