From: Sage Weil Date: Wed, 1 Apr 2015 00:24:35 +0000 (-0700) Subject: osd/osd_types: pg_t: add contains() helper to check objects is in a pg X-Git-Tag: v9.1.0~324^2~34 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cb4814748138eb345229a3ec8cfec7a52f87acb;p=ceph.git osd/osd_types: pg_t: add contains() helper to check objects is in a pg This calls the ghobject_t method that does the same, along with ps(). Signed-off-by: Sage Weil --- diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 55a4a9c4b786..45f8b733a0c7 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -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);