]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix remaining Inode::put() caller, and make method psuedo-private
authorSage Weil <sage@inktank.com>
Fri, 28 Jun 2013 18:50:11 +0000 (11:50 -0700)
committerSage Weil <sage@inktank.com>
Fri, 28 Jun 2013 18:50:11 +0000 (11:50 -0700)
Not sure I can make this actually private and make Client::put_inode() a
friend method (making all of Client a friend would defeat the purpose).
This works well enough, though!

Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc
src/client/Inode.h

index f89699ab67e81f01bae0903eab562c7dbf64867a..e0236605a8e47000c6aa2a3143af5d65a0a9bb71 100644 (file)
@@ -706,7 +706,7 @@ Dentry *Client::insert_dentry_inode(Dir *dir, const string& dname, LeaseStat *dl
     if (old_dentry)
       unlink(old_dentry, dir == old_dentry->dir);  // keep dir open if its the same dir
     dn = link(dir, dname, in, dn);
-    in->put();
+    put_inode(in);
     if (set_offset) {
       ldout(cct, 15) << " setting dn offset to " << dir->max_offset << dendl;
       dn->offset = dir->max_offset++;
@@ -2068,7 +2068,7 @@ void Client::handle_lease(MClientLease *m)
 void Client::put_inode(Inode *in, int n)
 {
   ldout(cct, 10) << "put_inode on " << *in << dendl;
-  int left = in->put(n);
+  int left = in->_put(n);
   if (left == 0) {
     // release any caps
     remove_all_caps(in);
index b33c38eb6f06e4a1ac61972cf58053d59e593f06..af4830b5c77d183cfe5edbcdcc07254136c1c0fe 100644 (file)
@@ -181,13 +181,15 @@ class Inode {
     lsubdout(cct, mds, 15) << "inode.get on " << this << " " <<  ino << '.' << snapid
                   << " now " << _ref << dendl;
   }
-  int put(int n=1) { 
+  /// private method to put a reference; see Client::put_inode()
+  int _put(int n=1) {
     _ref -= n; 
     lsubdout(cct, mds, 15) << "inode.put on " << this << " " << ino << '.' << snapid
                   << " now " << _ref << dendl;
     assert(_ref >= 0);
     return _ref;
   }
+
   int get_num_ref() {
     return _ref;
   }