From: Sage Weil Date: Thu, 4 Feb 2016 15:30:13 +0000 (-0500) Subject: os/bluestore/BlueStore: default Onode::true to false X-Git-Tag: v10.0.4~35^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8497099503ef6bc55eb664653980ad0ac751e574;p=ceph.git os/bluestore/BlueStore: default Onode::true to false 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 Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1b5e2f8b8d41..08c0ee51d8d5 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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); diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index a0c6547d5339..b1ea32013b0f 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -153,7 +153,7 @@ public: oid(o), key(k), dirty(false), - exists(true) { + exists(false) { } void flush();