]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/BlueStore: default Onode::true to false
authorSage Weil <sage@redhat.com>
Thu, 4 Feb 2016 15:30:13 +0000 (10:30 -0500)
committerSage Weil <sage@redhat.com>
Thu, 4 Feb 2016 15:30:13 +0000 (10:30 -0500)
This patch is mostly a wash, except that _rename now avoids doing the
_do_remove() work in the case where the object didn't exist before.

Reported-by: ie xingguo <xie.xingguo@zte.com.cn>
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 1b5e2f8b8d41799666519464842fc6d1a5d7e722..08c0ee51d8d5e1cd2370db4a7033a20328c5dfe2 100644 (file)
@@ -541,7 +541,6 @@ void BlueStore::OnodeHashLRU::rename(const ghobject_t& old_oid,
 
   // install a non-existent onode at old location
   po->second.reset(new Onode(old_oid, o->key));
-  po->second->exists = false;
   lru.push_back(*po->second);
 
   // add at new position and fix oid, key
@@ -711,11 +710,12 @@ BlueStore::OnodeRef BlueStore::Collection::get_onode(
     on = new Onode(oid, key);
     on->dirty = true;
     if (g_conf->bluestore_debug_misc && !create)
-      on->exists = on->dirty = false;
+      on->dirty = false;
   } else {
     // loaded
     assert(r >=0);
     on = new Onode(oid, key);
+    on->exists = true;
     bufferlist::iterator p = v.begin();
     ::decode(on->onode, p);
   }
@@ -5615,6 +5615,7 @@ int BlueStore::_zero(TransContext *txc,
           << " " << offset << "~" << length
           << dendl;
   int r = 0;
+  o->exists = true;
 
   EnodeRef enode;
   _dump_onode(o);
index a0c6547d53392bb60f69d66475520aaefdafc68a..b1ea32013b0fc854ce395a3c47e04e0b80766863 100644 (file)
@@ -153,7 +153,7 @@ public:
        oid(o),
        key(k),
        dirty(false),
-       exists(true) {
+       exists(false) {
     }
 
     void flush();