From: Igor Fedotov Date: Tue, 20 Oct 2020 11:15:02 +0000 (+0300) Subject: os/bluestore-tool: add allocator's "free-fragmentation" command X-Git-Tag: v17.1.0~2023^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37720%2Fhead;p=ceph.git os/bluestore-tool: add allocator's "free-fragmentation" command Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index b9cff81248a..d9c211d29bd 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();