diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-21 23:20:42 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-01 00:48:54 +0300 |
commit | a7400222e3eb7d5ce3820d2234905bbeafabd171 (patch) | |
tree | f630c4138ceb3889e08c5cd0029d2f07ec47dd0a /include/linux/fs.h | |
parent | ac7576f4b1da8c9c6bc1ae026c2b9e86ae617ba5 (diff) | |
download | linux-a7400222e3eb7d5ce3820d2234905bbeafabd171.tar.xz |
new helper: is_root_inode()
replace open-coded instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 00c8e4f65cb6..1c12c681803f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2789,6 +2789,11 @@ static inline void inode_has_no_xattr(struct inode *inode) inode->i_flags |= S_NOSEC; } +static inline bool is_root_inode(struct inode *inode) +{ + return inode == inode->i_sb->s_root->d_inode; +} + static inline bool dir_emit(struct dir_context *ctx, const char *name, int namelen, u64 ino, unsigned type) |