From: Jianjian Huo Date: Wed, 17 Feb 2016 16:36:57 +0000 (-0800) Subject: os/kstore: default Onode::true to false X-Git-Tag: v10.1.0~313^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c58fc206ab559c482bcffc56853150b1362aa249;p=ceph.git os/kstore: 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. Signed-off-by: Jianjian Huo --- diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index 9628c64d50ec..729cd14edbdf 100644 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -474,7 +474,6 @@ void KStore::OnodeHashLRU::rename(const ghobject_t& old_oid, // install a non-existent onode it its place po->second.reset(new Onode(old_oid, o->key)); - po->second->exists = false; lru.push_back(*po->second); // fix oid, key @@ -607,6 +606,7 @@ KStore::OnodeRef KStore::Collection::get_onode( // loaded assert(r >=0); on = new Onode(oid, key); + on->exists = true; bufferlist::iterator p = v.begin(); ::decode(on->onode, p); } @@ -2952,6 +2952,8 @@ int KStore::_zero(TransContext *txc, << " " << offset << "~" << length << dendl; int r = 0; + o->exists = true; + _dump_onode(o); _assign_nid(txc, o); diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index 52464d87f1f6..9b98a0a39732 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -70,7 +70,7 @@ public: oid(o), key(k), dirty(false), - exists(true) { + exists(false) { } void flush();