dcache: extrace and use d_unlinked()

d_unlinked() will be used in middle-term to ban checkpointing when opened
but unlinked file is detected, and in long term, to detect such situation
and special case on it.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Alexey Dobriyan 2009-05-04 03:32:03 +04:00 committed by Al Viro
parent 8c85e12512
commit f3da392e9f
3 changed files with 12 additions and 8 deletions

View file

@ -353,6 +353,11 @@ static inline int d_unhashed(struct dentry *dentry)
return (dentry->d_flags & DCACHE_UNHASHED);
}
static inline int d_unlinked(struct dentry *dentry)
{
return d_unhashed(dentry) && !IS_ROOT(dentry);
}
static inline struct dentry *dget_parent(struct dentry *dentry)
{
struct dentry *ret;