]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: add get_logical_pool()
authorSage Weil <sage@redhat.com>
Fri, 14 Sep 2018 13:44:37 +0000 (08:44 -0500)
committerPrashant D <pdhange@redhat.com>
Mon, 8 Oct 2018 21:36:52 +0000 (17:36 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 0c75020cad3cc404f45c73d6ec9a0d99f0bd1b78)

src/common/hobject.h
src/osd/osd_types.h

index c84bd25b5b3c110fad20f16c42f41cee2145f5d6..8b68f85b4675e51ddc695de69ff4e64c93095aac 100644 (file)
@@ -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();
index a7891c631085bd5eb8e8092207af3c43bc41dc9a..c9b5392d9b2dc411b99692093486953366e43553 100644 (file)
@@ -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());
   }