]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: default Onode::true to false 7681/head
authorJianjian Huo <samuel.huo@gmail.com>
Wed, 17 Feb 2016 16:36:57 +0000 (08:36 -0800)
committerJianjian Huo <samuel.huo@gmail.com>
Wed, 17 Feb 2016 16:36:57 +0000 (08:36 -0800)
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 <samuel.huo@gmail.com>
src/os/kstore/KStore.cc
src/os/kstore/KStore.h

index 9628c64d50ec326d900019161aead9a5200e47fc..729cd14edbdf88351423014d88b8e7e32d15a859 100644 (file)
@@ -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);
 
index 52464d87f1f690c549eddff4d5c6b9ed72863421..9b98a0a39732e2d233ff0a34b68d55296e062955 100644 (file)
@@ -70,7 +70,7 @@ public:
        oid(o),
        key(k),
        dirty(false),
-       exists(true) {
+       exists(false) {
     }
 
     void flush();