From 716be22367e40a5b8b0e7cc0dbea4f4f127dfbbe Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Tue, 20 Oct 2020 14:15:02 +0300 Subject: [PATCH] os/bluestore-tool: add allocator's "free-fragmentation" command Signed-off-by: Igor Fedotov --- src/os/bluestore/bluestore_tool.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index b9cff81248a0..d9c211d29bd2 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -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(); -- 2.47.3