// Device-inspection operations (--op)
DUMP_SUPERBLOCK,
+
+ // Maintenance operations (--op)
+ GC,
};
std::string to_string(operation_type_t op) {
case operation_type_t::SET_SIZE: return "set-size";
case operation_type_t::CLEAR_DATA_DIGEST: return "clear-data-digest";
case operation_type_t::DUMP_SUPERBLOCK: return "dump-superblock";
+ case operation_type_t::GC: return "gc";
default: return "unknown";
}
}
if (op_str == "list") return operation_type_t::LIST_OBJECTS;
if (op_str == "info") return operation_type_t::INFO;
if (op_str == "dump-superblock") return operation_type_t::DUMP_SUPERBLOCK;
+ if (op_str == "gc") return operation_type_t::GC;
return tl::unexpected("Unsupported PG operation: " + op_str);
}
// Resolve object and pgid before executing operations
if (config.operation->op != operation_type_t::LIST_PGS &&
- config.operation->op != operation_type_t::DUMP_SUPERBLOCK) {
+ config.operation->op != operation_type_t::DUMP_SUPERBLOCK &&
+ config.operation->op != operation_type_t::GC) {
bool resolved = co_await resolve_operation_parameters(st, config);
if (!resolved) {
co_return EXIT_FAILURE;
break;
}
+ case operation_type_t::GC: {
+ co_await st.do_gc();
+ break;
+ }
+
default:
fmt::println(std::cerr, "Operation {} not implemented yet", to_string(op.op));
co_return EXIT_FAILURE;