mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
vfs: add d_is_dir()
Add d_is_dir(dentry) helper which is analogous to S_ISDIR(). To avoid confusion, rename d_is_directory() to d_can_lookup(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Reviewed-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
455c6fdbd2
commit
44b1d53043
2 changed files with 17 additions and 13 deletions
|
@ -429,7 +429,7 @@ static inline unsigned __d_entry_type(const struct dentry *dentry)
|
|||
return dentry->d_flags & DCACHE_ENTRY_TYPE;
|
||||
}
|
||||
|
||||
static inline bool d_is_directory(const struct dentry *dentry)
|
||||
static inline bool d_can_lookup(const struct dentry *dentry)
|
||||
{
|
||||
return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE;
|
||||
}
|
||||
|
@ -439,6 +439,11 @@ static inline bool d_is_autodir(const struct dentry *dentry)
|
|||
return __d_entry_type(dentry) == DCACHE_AUTODIR_TYPE;
|
||||
}
|
||||
|
||||
static inline bool d_is_dir(const struct dentry *dentry)
|
||||
{
|
||||
return d_can_lookup(dentry) || d_is_autodir(dentry);
|
||||
}
|
||||
|
||||
static inline bool d_is_symlink(const struct dentry *dentry)
|
||||
{
|
||||
return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue