From: Samuel Just Date: Thu, 29 Nov 2012 21:51:41 +0000 (-0800) Subject: hobject_t: make max private X-Git-Tag: v0.55~12^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=82517f1bf07809b820bca3f80473acf7fd89d68e;p=ceph.git hobject_t: make max private Signed-off-by: Samuel Just --- diff --git a/src/os/hobject.h b/src/os/hobject.h index 9a1c207e7963..00097f471573 100644 --- a/src/os/hobject.h +++ b/src/os/hobject.h @@ -31,7 +31,9 @@ struct hobject_t { object_t oid; snapid_t snap; uint32_t hash; +private: bool max; +public: int64_t pool; string nspace; @@ -108,6 +110,12 @@ public: void decode(json_spirit::Value& v); void dump(Formatter *f) const; static void generate_test_instances(list& o); + friend bool operator<(const hobject_t&, const hobject_t&); + friend bool operator>(const hobject_t&, const hobject_t&); + friend bool operator<=(const hobject_t&, const hobject_t&); + friend bool operator>=(const hobject_t&, const hobject_t&); + friend bool operator==(const hobject_t&, const hobject_t&); + friend bool operator!=(const hobject_t&, const hobject_t&); }; WRITE_CLASS_ENCODER(hobject_t) diff --git a/src/test/filestore/store_test.cc b/src/test/filestore/store_test.cc index 55fde77f0fc0..3a41fa10e4c6 100644 --- a/src/test/filestore/store_test.cc +++ b/src/test/filestore/store_test.cc @@ -212,7 +212,7 @@ TEST_F(StoreTest, ManyObjectTest) { ASSERT_EQ(r, 0); listed.insert(objects.begin(), objects.end()); if (objects.size() < 50) { - ASSERT_TRUE(next.max); + ASSERT_TRUE(next.is_max()); break; } objects.clear(); @@ -385,7 +385,7 @@ public: ASSERT_TRUE(sorted(objects)); objects_set.insert(objects.begin(), objects.end()); objects.clear(); - if (next.max) break; + if (next.is_max()) break; current = next; } ASSERT_EQ(objects_set.size(), available_objects.size()); @@ -529,7 +529,7 @@ TEST_F(StoreTest, HashCollisionTest) { listed.insert(*i); } if (objects.size() < 50) { - ASSERT_TRUE(next.max); + ASSERT_TRUE(next.is_max()); break; } objects.clear();