]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_type.h: kill pg_missing_set.have_old
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 16 Oct 2017 08:09:51 +0000 (16:09 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 24 Oct 2017 00:37:17 +0000 (08:37 +0800)
which has no consumers, and removing the unused code should
always be the preferred option.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/osd_types.h
src/test/osd/types.cc

index a1201c537e4dd80fc5266746d52b3e715a4fae03..392adfaf8b22a75b55c97ff0a6816e6515eac53f 100644 (file)
@@ -3745,7 +3745,6 @@ public:
   virtual bool have_missing() const = 0;
   virtual bool is_missing(const hobject_t& oid, pg_missing_item *out = nullptr) const = 0;
   virtual bool is_missing(const hobject_t& oid, eversion_t v) const = 0;
-  virtual eversion_t have_old(const hobject_t& oid) const = 0;
   virtual ~pg_missing_const_i() {}
 };
 
@@ -3836,14 +3835,6 @@ public:
       return false;
     return true;
   }
-  eversion_t have_old(const hobject_t& oid) const override {
-    map<hobject_t, item>::const_iterator m =
-      missing.find(oid);
-    if (m == missing.end())
-      return eversion_t();
-    const item &item(m->second);
-    return item.have;
-  }
 
   void claim(pg_missing_set& o) {
     static_assert(!TrackChanges, "Can't use claim with TrackChanges");
index 16154fb06cac0b149d28200a271257f2227939f7..6491cc74c0c9d2da609c95a255cde4478af80a6a 100644 (file)
@@ -723,18 +723,6 @@ TEST(pg_missing_t, is_missing)
   }
 }
 
-TEST(pg_missing_t, have_old)
-{
-  hobject_t oid(object_t("objname"), "key", 123, 456, 0, "");
-  pg_missing_t missing;
-  EXPECT_EQ(eversion_t(), missing.have_old(oid));
-  missing.add(oid, eversion_t(), eversion_t(), false);
-  EXPECT_EQ(eversion_t(), missing.have_old(oid));
-  eversion_t have(1,1);
-  missing.revise_have(oid, have);
-  EXPECT_EQ(have, missing.have_old(oid));
-}
-
 TEST(pg_missing_t, add_next_event)
 {
   hobject_t oid(object_t("objname"), "key", 123, 456, 0, "");