From: Sage Weil Date: Fri, 14 Sep 2018 13:44:37 +0000 (-0500) Subject: common/hobject: add get_logical_pool() X-Git-Tag: v13.2.3~99^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e419fa65b801a71e85d060cc5d2f5d41b319a7ae;p=ceph.git common/hobject: add get_logical_pool() Signed-off-by: Sage Weil (cherry picked from commit 0c75020cad3cc404f45c73d6ec9a0d99f0bd1b78) --- diff --git a/src/common/hobject.h b/src/common/hobject.h index c84bd25b5b3c..8b68f85b4675 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -101,6 +101,12 @@ public: bool is_meta() const { return is_meta_pool(pool); } + int64_t get_logical_pool() const { + if (is_temp_pool(pool)) + return get_temp_pool(pool); // it's reversible + else + return pool; + } hobject_t() : snap(0), hash(0), max(false), pool(INT64_MIN) { build_hash_cache(); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index a7891c631085..c9b5392d9b2d 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -420,14 +420,12 @@ struct pg_t { bool contains(int bits, const ghobject_t& oid) { return - ((int64_t)m_pool == oid.hobj.pool || - hobject_t::get_temp_pool(m_pool) == oid.hobj.pool) && + (int64_t)m_pool == oid.hobj.get_logical_pool() && oid.match(bits, ps()); } bool contains(int bits, const hobject_t& oid) { return - ((int64_t)m_pool == oid.pool || - hobject_t::get_temp_pool(m_pool) == oid.pool) && + (int64_t)m_pool == oid.get_logical_pool() && oid.match(bits, ps()); }