From dd5d0e22f709ca07d3ea96a34be8c17d61487165 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 26 Feb 2018 22:30:59 +0800 Subject: [PATCH] ceph-objectstore-tool: do not check queue_transaction()'s retval it never fails. Signed-off-by: Kefu Chai --- src/tools/ceph_objectstore_tool.cc | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 2137240bc4f..ef77befeafb 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -684,13 +684,8 @@ int set_inc_osdmap(ObjectStore *store, epoch_t e, bufferlist& bl, bool force) { ObjectStore::Transaction t; t.write(coll_t::meta(), inc_oid, 0, bl.length(), bl); t.truncate(coll_t::meta(), inc_oid, bl.length()); - int ret = store->queue_transaction(ch, std::move(t)); - if (ret) { - cerr << "Failed to set inc-osdmap (" << inc_oid << "): " << ret << std::endl; - } else { - cout << "Wrote inc-osdmap." << inc.epoch << std::endl; - } - return ret; + store->queue_transaction(ch, std::move(t)); + return 0; } int get_inc_osdmap(ObjectStore *store, epoch_t e, bufferlist& bl) @@ -732,13 +727,8 @@ int set_osdmap(ObjectStore *store, epoch_t e, bufferlist& bl, bool force) { ObjectStore::Transaction t; t.write(coll_t::meta(), full_oid, 0, bl.length(), bl); t.truncate(coll_t::meta(), full_oid, bl.length()); - int ret = store->queue_transaction(ch, std::move(t)); - if (ret) { - cerr << "Failed to set osdmap (" << full_oid << "): " << ret << std::endl; - } else { - cout << "Wrote osdmap." << osdmap.get_epoch() << std::endl; - } - return ret; + store->queue_transaction(ch, std::move(t)); + return 0; } int get_osdmap(ObjectStore *store, epoch_t e, OSDMap &osdmap, bufferlist& bl) @@ -2319,13 +2309,7 @@ struct do_fix_lost : public action_on_object_t { ObjectStore::Transaction t; t.setattr(coll, ghobj, OI_ATTR, bl); auto ch = store->open_collection(coll); - int r = store->queue_transaction(ch, std::move(t)); - if (r < 0) { - cerr << "Error getting fixing attr on : " << make_pair(coll, ghobj) - << ", " - << cpp_strerror(r) << std::endl; - return r; - } + store->queue_transaction(ch, std::move(t)); } return 0; } -- 2.39.5