summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-11-29 13:51:41 -0800
committerSamuel Just <sam.just@inktank.com>2012-11-29 13:51:51 -0800
commit82517f1bf07809b820bca3f80473acf7fd89d68e (patch)
tree7f510794bc5c92d5dc02b085bc15b5b3f36fb7a7
parentf8f452f3244b03c2b32ba71c6e9a31c59429c019 (diff)
downloadceph-82517f1bf07809b820bca3f80473acf7fd89d68e.tar.gz
hobject_t: make max private
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/os/hobject.h8
-rw-r--r--src/test/filestore/store_test.cc6
2 files changed, 11 insertions, 3 deletions
diff --git a/src/os/hobject.h b/src/os/hobject.h
index 9a1c207e796..00097f47157 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<hobject_t*>& 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 55fde77f0fc..3a41fa10e4c 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();