From: Sage Weil Date: Fri, 28 Jun 2013 18:50:11 +0000 (-0700) Subject: client: fix remaining Inode::put() caller, and make method psuedo-private X-Git-Tag: v0.66~14^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9af3b86b25574e4d2cdfd43e61028cffa19bdeb1;p=ceph.git client: fix remaining Inode::put() caller, and make method psuedo-private 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index f89699ab67e..e0236605a8e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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); diff --git a/src/client/Inode.h b/src/client/Inode.h index b33c38eb6f0..af4830b5c77 100644 --- a/src/client/Inode.h +++ b/src/client/Inode.h @@ -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; }