summaryrefslogtreecommitdiff
path: root/fs/fuse/readdir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-03-02 04:37:10 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2021-03-08 18:19:35 +0300
commit6e3e2c4362e41a2f18e3f7a5ad81bd2f49a47b85 (patch)
treeef51a46d8ebbfa4300e6fa4f1c20b171b351bf13 /fs/fuse/readdir.c
parenta38fd8748464831584a19438cbb3082b5a2dab15 (diff)
downloadlinux-6e3e2c4362e41a2f18e3f7a5ad81bd2f49a47b85.tar.xz
new helper: inode_wrong_type()
inode_wrong_type(inode, mode) returns true if setting inode->i_mode to given value would've changed the inode type. We have enough of those checks open-coded to make a helper worthwhile. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fuse/readdir.c')
-rw-r--r--fs/fuse/readdir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c
index 3441ffa740f3..277f7041d55a 100644
--- a/fs/fuse/readdir.c
+++ b/fs/fuse/readdir.c
@@ -202,7 +202,7 @@ retry:
inode = d_inode(dentry);
if (!inode ||
get_node_id(inode) != o->nodeid ||
- ((o->attr.mode ^ inode->i_mode) & S_IFMT)) {
+ inode_wrong_type(inode, o->attr.mode)) {
d_invalidate(dentry);
dput(dentry);
goto retry;