]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: pg_t: add contains() helper to check objects is in a pg
authorSage Weil <sage@redhat.com>
Wed, 1 Apr 2015 00:24:35 +0000 (17:24 -0700)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:53 +0000 (17:03 -0400)
This calls the ghobject_t method that does the same, along with ps().

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/osd_types.h

index 55a4a9c4b78645405eb6a9397f901e3874e7fc4f..45f8b733a0c7c3520efbc413abc5637bcdc5b4e7 100644 (file)
@@ -342,6 +342,10 @@ struct pg_t {
    */
   unsigned get_split_bits(unsigned pg_num) const;
 
+  bool contains(int bits, const ghobject_t& oid) {
+    return oid.match(bits, ps());
+  }
+
   void encode(bufferlist& bl) const {
     __u8 v = 1;
     ::encode(v, bl);