]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: do not set both PGMETA_OMAP and PERPOOL_OMAP
authorSage Weil <sage@redhat.com>
Mon, 5 Aug 2019 17:52:56 +0000 (12:52 -0500)
committerSage Weil <sage@redhat.com>
Thu, 8 Aug 2019 22:26:24 +0000 (17:26 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluestore_types.h

index fc7640ad5c8b23e89af78c6e3cf28b3c44663400..97fed8c7f9081ed1ce94c972bc6e26143e842bc3 100644 (file)
@@ -13306,9 +13306,10 @@ int BlueStore::_omap_setkeys(TransContext *txc,
   auto p = bl.cbegin();
   __u32 num;
   if (!o->onode.has_omap()) {
-    o->onode.set_omap_flags();
     if (o->oid.is_pgmeta()) {
-      o->onode.flags |= bluestore_onode_t::FLAG_PGMETA_OMAP;
+      o->onode.set_omap_flags_pgmeta();
+    } else {
+      o->onode.set_omap_flags();
     }
     txc->write_onode(o);
 
@@ -13350,9 +13351,10 @@ int BlueStore::_omap_setheader(TransContext *txc,
   int r;
   string key;
   if (!o->onode.has_omap()) {
-    o->onode.set_omap_flags();
     if (o->oid.is_pgmeta()) {
-      o->onode.flags |= bluestore_onode_t::FLAG_PGMETA_OMAP;
+      o->onode.set_omap_flags_pgmeta();
+    } else {
+      o->onode.set_omap_flags();
     }
     txc->write_onode(o);
 
@@ -13505,9 +13507,10 @@ int BlueStore::_clone(TransContext *txc,
   }
   if (oldo->onode.has_omap()) {
     dout(20) << __func__ << " copying omap data" << dendl;
-    newo->onode.set_omap_flags();
     if (newo->oid.is_pgmeta()) {
-      newo->onode.flags |= bluestore_onode_t::FLAG_PGMETA_OMAP;
+      newo->onode.set_omap_flags_pgmeta();
+    } else {
+      newo->onode.set_omap_flags();
     }
     const string& prefix = newo->get_omap_prefix();
     KeyValueDB::Iterator it = db->get_iterator(prefix);
index 9db13c3ff456d6fb58fc59e1e56afb7a40f258d0..aff9e07df202464b40b1ede05c695675e0286e56 100644 (file)
@@ -955,6 +955,9 @@ struct bluestore_onode_t {
   void set_omap_flags() {
     set_flag(FLAG_OMAP | FLAG_PERPOOL_OMAP);
   }
+  void set_omap_flags_pgmeta() {
+    set_flag(FLAG_OMAP | FLAG_PGMETA_OMAP);
+  }
 
   void clear_omap_flag() {
     clear_flag(FLAG_OMAP);