aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-21 15:20:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-31 17:48:54 -0400
commita7400222e3eb7d5ce3820d2234905bbeafabd171 (patch)
treef630c4138ceb3889e08c5cd0029d2f07ec47dd0a /include/linux/fs.h
parentac7576f4b1da8c9c6bc1ae026c2b9e86ae617ba5 (diff)
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)
2789 inode->i_flags |= S_NOSEC; 2789 inode->i_flags |= S_NOSEC;
2790} 2790}
2791 2791
2792static inline bool is_root_inode(struct inode *inode)
2793{
2794 return inode == inode->i_sb->s_root->d_inode;
2795}
2796
2792static inline bool dir_emit(struct dir_context *ctx, 2797static inline bool dir_emit(struct dir_context *ctx,
2793 const char *name, int namelen, 2798 const char *name, int namelen,
2794 u64 ino, unsigned type) 2799 u64 ino, unsigned type)