]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: Add --oid option to ceph-osdomap-tool
authorDavid Zafman <dzafman@redhat.com>
Tue, 7 Feb 2017 05:09:42 +0000 (21:09 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 27 Mar 2017 15:31:12 +0000 (08:31 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/tools/ceph_osdomap_tool.cc

index 1ba13f082f1f3f390757b75bf6d06d7af9ddf9f7..eead17684e3e199d803424c4d0ddeab136962dbd 100644 (file)
@@ -27,12 +27,13 @@ using namespace std;
 
 int main(int argc, char **argv) {
   po::options_description desc("Allowed options");
-  string store_path, cmd, out_path;
+  string store_path, cmd, out_path, oid;
   desc.add_options()
     ("help", "produce help message")
     ("omap-path", po::value<string>(&store_path),
      "path to mon directory, mandatory (current/omap usually)")
     ("paranoid", "use paranoid checking")
+    ("oid", po::value<string>(&oid), "Restrict to this object id when dumping objects")
     ("command", po::value<string>(&cmd),
      "command arg is one of [dump-raw-keys, dump-raw-key-vals, dump-objects, dump-objects-with-keys, check], mandatory")
     ;
@@ -123,6 +124,8 @@ int main(int argc, char **argv) {
     for (vector<ghobject_t>::iterator i = objects.begin();
         i != objects.end();
         ++i) {
+      if (vm.count("oid") != 0 && i->hobj.oid.name != oid)
+        continue;
       std::cout << *i << std::endl;
     }
     r = 0;
@@ -136,6 +139,8 @@ int main(int argc, char **argv) {
     for (vector<ghobject_t>::iterator i = objects.begin();
         i != objects.end();
         ++i) {
+      if (vm.count("oid") != 0 && i->hobj.oid.name != oid)
+        continue;
       std::cout << "Object: " << *i << std::endl;
       ObjectMap::ObjectMapIterator j = omap.get_iterator(ghobject_t(i->hobj));
       for (j->seek_to_first(); j->valid(); j->next()) {