From 8cb4814748138eb345229a3ec8cfec7a52f87acb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 31 Mar 2015 17:24:35 -0700 Subject: [PATCH] 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 --- src/osd/osd_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 55a4a9c4b78..45f8b733a0c 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); -- 2.47.3