d_invalidate() is the standard VFS method to invalidate dentry.
compare to d_delete(), it also try shrinking children dentries.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
d_prune_aliases(inode);
/*
* For non-directory inode, d_find_alias() only returns
- * connected dentry. After calling d_delete(), the dentry
- * become disconnected.
+ * connected dentry. After calling d_invalidate(), the
+ * dentry become disconnected.
*
- * For directory inode, d_find_alias() only can return
+ * For directory inode, d_find_alias() can return
* disconnected dentry. But directory inode should have
* one alias at most.
*/
dput(dn);
break;
}
- d_delete(dn);
+ d_invalidate(dn);
if (prev)
dput(prev);
prev = dn;