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-07-22 22:28:58 -0700
commit03653ebda3f5b103dceccee8f61f5f82009c28a8 (patch)
tree89d05ed508abae8c14a5deac4d838089b8696abd
parent84b41987ad0587c7d73e854d319604bdc7f81146 (diff)
downloadceph-03653ebda3f5b103dceccee8f61f5f82009c28a8.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 30e014ab785..7bbb749aa52 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -1776,6 +1776,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