summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-28 11:50:11 -0700
committerSage Weil <sage@inktank.com>2013-07-13 14:19:26 -0700
commit1df78ad73df581bc7537688ae28bda820b089a13 (patch)
tree29de898a5d5c64397f6dd1b1827954e8edf1549c
parentfea024cc3dd2c6fd9ff322d1cd15e0d75c92eca5 (diff)
downloadceph-1df78ad73df581bc7537688ae28bda820b089a13.tar.gz
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 <sage@inktank.com> (cherry picked from commit 9af3b86b25574e4d2cdfd43e61028cffa19bdeb1)
-rw-r--r--src/client/Client.cc4
-rw-r--r--src/client/Inode.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc
index 626179c4d33..1c901e280fb 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -703,7 +703,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++;
@@ -2066,7 +2066,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;
}