]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: take refs for inflight lock ops
authorSage Weil <sage@inktank.com>
Tue, 23 Oct 2012 13:03:09 +0000 (06:03 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Oct 2012 18:31:44 +0000 (11:31 -0700)
These are all dead/unused; should probably just rip out this code!

Signed-off-by: Sage Weil <sage@inktank.com>
src/osdc/ObjectCacher.cc

index 4cc919cb4f3e2097035bb5e1bd5d15faebb9875b..425cda2be6e1ccdd5bfa722c15ef8b23a25dd0b5 100644 (file)
@@ -701,7 +701,7 @@ void ObjectCacher::lock_ack(int64_t poolid, list<sobject_t>& oids, tid_t tid)
     }
 
     finish_contexts(cct, ls);
-
+    ob->put();
   }
 }
 
@@ -1249,6 +1249,8 @@ void ObjectCacher::rdlock(Object *o)
   
   // stake our claim.
   o->rdlock_ref++;  
+
+  o->get();
   
   // wait?
   if (o->lock_state == Object::LOCK_RDLOCKING ||
@@ -1295,7 +1297,9 @@ void ObjectCacher::wrlock(Object *o)
   
   // stake our claim.
   o->wrlock_ref++;  
-  
+
+  o->get();
+
   // wait?
   if (o->lock_state == Object::LOCK_WRLOCKING ||
       o->lock_state == Object::LOCK_UPGRADING) {
@@ -1330,6 +1334,8 @@ void ObjectCacher::rdunlock(Object *o)
 
   o->lock_state = Object::LOCK_RDUNLOCKING;
 
+  o->get();
+
   C_LockAck *lockack = new C_LockAck(this, o->oloc.pool, o->get_soid());
   C_WriteCommit *commit = new C_WriteCommit(this, o->oloc.pool,
                                             o->get_soid(), 0, 0);
@@ -1354,6 +1360,8 @@ void ObjectCacher::wrunlock(Object *o)
 
   flush(o, 0, 0);  // flush first
 
+  o->get();
+
   int op = 0;
   if (o->rdlock_ref > 0) {
     ldout(cct, 10) << "wrunlock rdlock " << *o << dendl;