]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: Fix inode ref counting in rename.
authorGreg Farnum <gregf@hq.newdream.net>
Fri, 17 Jul 2009 18:10:53 +0000 (11:10 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Fri, 17 Jul 2009 18:10:53 +0000 (11:10 -0700)
Change error outputting on Inode get/put, but commented out again.

src/client/Client.cc
src/client/Client.h

index 47750c57f035395266962d02a0dadbf4274ef9f6..6e6d945dc1e13446c035ef7cda86063f496a5a45 100644 (file)
@@ -2896,6 +2896,7 @@ int Client::rename(const char *relfrom, const char *relto)
   r = path_walk(to, &todir);
   if (r < 0)
     goto out_unlock;
+  todir->get();
   r = _rename(fromdir, fromname.c_str(), todir, toname.c_str());
   put_inode(todir);
  out_unlock:
index be6ecf6fe0be5a0451e09c08ea42f0ee1adc9e91..3839a90891f7a6f35d35d6622f2c9513a3f3d910 100644 (file)
@@ -379,11 +379,12 @@ class Inode {
 
   void get() { 
     ref++; 
-    //cout << "inode.get on " << this << " " << hex << inode.ino << dec << " now " << ref << std::endl;
+    //dout(0) << "inode.get on " << this << " " << hex << ino << dec << " now " << ref << dendl;
   }
   void put(int n=1) { 
-    ref -= n; assert(ref >= 0); 
-    //cout << "inode.put on " << this << " " << hex << inode.ino << dec << " now " << ref << std::endl;
+    ref -= n; 
+    //dout(0) << "inode.put on " << this << " " << hex << ino << dec << " now " << ref << dendl;
+    assert(ref >= 0);
   }
 
   void ll_get() {