From 0fc6bd2777edf24a044f454beacf1647cc52f9fe Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 19 May 2014 20:55:47 -0700 Subject: [PATCH] ceph_filestore_dump: Add rm-omap object command Signed-off-by: David Zafman --- src/tools/ceph_filestore_dump.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/tools/ceph_filestore_dump.cc b/src/tools/ceph_filestore_dump.cc index 23e748437723a..c85ddf689cdc7 100644 --- a/src/tools/ceph_filestore_dump.cc +++ b/src/tools/ceph_filestore_dump.cc @@ -1417,6 +1417,23 @@ int do_set_omap(ObjectStore *store, coll_t coll, ghobject_t &ghobj, string key, return 0; } +int do_rm_omap(ObjectStore *store, coll_t coll, ghobject_t &ghobj, string key) +{ + ObjectStore::Transaction tran; + ObjectStore::Transaction *t = &tran; + set keys; + + keys.insert(key); + + if (debug) + cerr << "Rm_omap " << ghobj << std::endl; + + t->omap_rmkeys(coll, ghobj, keys); + + store->apply_transaction(*t); + return 0; +} + void usage(po::options_description &desc) { cerr << std::endl; @@ -1900,6 +1917,13 @@ int main(int argc, char **argv) if (r) ret = 1; goto out; + } else if (objcmd == "rm-omap") { + if (vm.count("arg1") == 0) + usage(desc); + r = do_rm_omap(fs, coll, ghobj, arg1); + if (r) + ret = 1; + goto out; } cerr << "Unknown object command '" << objcmd << "'" << std::endl; usage(desc); -- 2.39.5