summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-21 23:20:42 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-01 00:48:54 +0300
commita7400222e3eb7d5ce3820d2234905bbeafabd171 (patch)
treef630c4138ceb3889e08c5cd0029d2f07ec47dd0a /include/linux/fs.h
parentac7576f4b1da8c9c6bc1ae026c2b9e86ae617ba5 (diff)
downloadlinux-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.h5
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)