summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-07-21 10:21:13 +0800
committerSage Weil <sage@inktank.com>2013-08-08 22:29:59 -0700
commitca3987fff1928cd6b74a969a68ba62f79a900550 (patch)
tree303cafa8fd95e37da4a87ab920e957dd26775e18
parent151e6d24e4512076731e7dbe9707bd36b2aad986 (diff)
downloadceph-ca3987fff1928cd6b74a969a68ba62f79a900550.tar.gz
mds: notify clients about deleted inode
To make sure clients trim the deleted inode from the their cache ASAP. After all clients release the inode, we can reclaim space. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mds/Locker.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index 084d64aeb9c..99bd761e0f7 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -1777,6 +1777,10 @@ bool Locker::issue_caps(CInode *in, Capability *only_cap)
continue;
}
+ // notify clients about deleted inode, to make sure they release caps ASAP.
+ if (in->inode.nlink == 0)
+ wanted |= CEPH_CAP_LINK_SHARED;
+
// are there caps that the client _wants_ and can have, but aren't pending?
// or do we need to revoke?
if (((wanted & allowed) & ~pending) || // missing wanted+allowed caps