]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: add get_logical_pool() 24085/head
authorSage Weil <sage@redhat.com>
Fri, 14 Sep 2018 13:44:37 +0000 (08:44 -0500)
committerSage Weil <sage@redhat.com>
Fri, 14 Sep 2018 13:44:37 +0000 (08:44 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/hobject.h
src/osd/osd_types.h

index 2cea82ffbd2c3e88ab9365f050c443e4babe1330..b96dd907febd2ac9aedfb18635f0cc674101c468 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 2ef28f886e599510ef15891a53804aed779100eb..e379567e378ba08b24346faa21f67f08d5cec809 100644 (file)
@@ -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());
   }