]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-objectstore-tool: do not check action_on_object_t::call()'s retval 20593/head
authorKefu Chai <kchai@redhat.com>
Mon, 26 Feb 2018 14:34:37 +0000 (22:34 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 26 Feb 2018 17:08:23 +0000 (01:08 +0800)
it never fails.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/tools/ceph_objectstore_tool.cc

index ef77befeafb0dac3f2ce368c7cab33798ef79252..93115fcc9a10bf73a9019285ae79a1903916c3d3 100644 (file)
@@ -76,7 +76,7 @@ bool dry_run;
 
 struct action_on_object_t {
   virtual ~action_on_object_t() {}
-  virtual int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) = 0;
+  virtual void call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) = 0;
 };
 
 int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_object_t &action, bool debug)
@@ -120,9 +120,7 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje
          }
        }
       }
-      r = action.call(store, coll, *obj, oi);
-      if (r < 0)
-       return r;
+      action.call(store, coll, *obj, oi);
     }
   }
   return 0;
@@ -263,13 +261,13 @@ struct lookup_ghobject : public action_on_object_t {
   lookup_ghobject(const string& name, const boost::optional<std::string>& nspace, bool need_snapset = false) : _name(name),
                  _namespace(nspace), _need_snapset(need_snapset) { }
 
-  int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) override {
+  void call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) override {
     if (_need_snapset && !ghobj.hobj.has_snapset())
-      return 0;
+      return;
     if ((_name.length() == 0 || ghobj.hobj.oid.name == _name) &&
         (!_namespace || ghobj.hobj.nspace == _namespace))
       _objects.insert(coll, ghobj);
-    return 0;
+    return;
   }
 
   int size() const {
@@ -2294,7 +2292,7 @@ int do_set_omaphdr(ObjectStore *store, coll_t coll,
 }
 
 struct do_fix_lost : public action_on_object_t {
-  int call(ObjectStore *store, coll_t coll,
+  void call(ObjectStore *store, coll_t coll,
                   ghobject_t &ghobj, object_info_t &oi) override {
     if (oi.is_lost()) {
       cout << coll << "/" << ghobj << " is lost";
@@ -2302,7 +2300,7 @@ struct do_fix_lost : public action_on_object_t {
         cout << ", fixing";
       cout << std::endl;
       if (dry_run)
-        return 0;
+        return;
       oi.clear_flag(object_info_t::FLAG_LOST);
       bufferlist bl;
       encode(oi, bl, -1);  /* fixme: using full features */
@@ -2311,7 +2309,7 @@ struct do_fix_lost : public action_on_object_t {
       auto ch = store->open_collection(coll);
       store->queue_transaction(ch, std::move(t));
     }
-    return 0;
+    return;
   }
 };