]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-osdomap-tool: Add compact comand option
authorDavid Zafman <dzafman@redhat.com>
Thu, 19 Oct 2017 19:56:58 +0000 (12:56 -0700)
committerNathan Cutler <ncutler@suse.com>
Sun, 28 Jan 2018 22:45:29 +0000 (23:45 +0100)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit b1f397f4fc3313ee0325722156759bfe32286c6b)

src/tools/ceph_osdomap_tool.cc

index 52fa7ae710c64159e52b77242b8c73c53820615d..341fdffe0614c1f915212b2b185081ec0260bea6 100644 (file)
@@ -37,7 +37,7 @@ int main(int argc, char **argv) {
     ("debug", "Additional debug output from DBObjectMap")
     ("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, dump-headers, repair], mandatory")
+     "command arg is one of [dump-raw-keys, dump-raw-key-vals, dump-objects, dump-objects-with-keys, check, dump-headers, repair, compact], mandatory")
     ("backend", po::value<string>(&backend),
      "DB backend (default rocksdb)")
     ;
@@ -203,6 +203,9 @@ int main(int argc, char **argv) {
     omap.state.v = 2;
     omap.state.legacy = false;
     omap.set_state();
+  } else if (cmd == "compact") {
+    omap.compact();
+    return 0;
   } else {
     std::cerr << "Did not recognize command " << cmd << std::endl;
     return 1;