From 0c75020cad3cc404f45c73d6ec9a0d99f0bd1b78 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Sep 2018 08:44:37 -0500 Subject: [PATCH] common/hobject: add get_logical_pool() Signed-off-by: Sage Weil --- src/common/hobject.h | 6 ++++++ src/osd/osd_types.h | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/hobject.h b/src/common/hobject.h index 2cea82ffbd2c3..b96dd907febd2 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 2ef28f886e599..e379567e378ba 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -425,14 +425,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()); } -- 2.39.5