]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore-tool: add allocator's "free-fragmentation" command 37720/head
authorIgor Fedotov <ifedotov@suse.com>
Tue, 20 Oct 2020 11:15:02 +0000 (14:15 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Tue, 20 Oct 2020 11:17:14 +0000 (14:17 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/bluestore_tool.cc

index b9cff81248a029c853e86ba09b563baaa06f697b..d9c211d29bd266735258814f1585a1dad966ef40 100644 (file)
@@ -274,6 +274,7 @@ int main(int argc, char **argv)
         "bluefs-log-dump, "
         "free-dump, "
         "free-score, "
+        "free-fragmentation, "
         "bluefs-stats, "
         "reshard")
     ;
@@ -390,7 +391,7 @@ int main(int argc, char **argv)
       exit(EXIT_FAILURE);
     }
   }
-  if (action == "free-score" || action == "free-dump") {
+  if (action == "free-score" || action == "free-dump" || action == "free-fragmentation") {
     if (path.empty()) {
       cerr << "must specify bluestore path" << std::endl;
       exit(EXIT_FAILURE);
@@ -853,10 +854,11 @@ int main(int argc, char **argv)
       }
       return r;
     }
-  } else  if (action == "free-dump" || action == "free-score") {
+  } else  if (action == "free-dump" || action == "free-score" || action == "fragmentation") {
     AdminSocket *admin_socket = g_ceph_context->get_admin_socket();
     ceph_assert(admin_socket);
-    std::string action_name = action == "free-dump" ? "dump" : "score";
+    std::string action_name = action == "free-dump" ? "dump" :
+                              action == "free-score" ? "score" : "fragmentation";
     validate_path(cct.get(), path, false);
     BlueStore bluestore(cct.get(), path);
     int r = bluestore.cold_open();