From: Yan, Zheng Date: Sun, 21 Jul 2013 02:21:13 +0000 (+0800) Subject: mds: notify clients about deleted inode X-Git-Tag: v0.68~98 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca3987fff1928cd6b74a969a68ba62f79a900550;p=ceph.git 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 Reviewed-by: Sage Weil --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 084d64aeb9c8..99bd761e0f7c 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