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>
This commit is contained in:
Yan, Zheng 2013-07-21 10:21:13 +08:00 committed by Sage Weil
parent 151e6d24e4
commit ca3987fff1

View File

@ -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