diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2021-03-02 04:37:10 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2021-03-08 18:19:35 +0300 |
commit | 6e3e2c4362e41a2f18e3f7a5ad81bd2f49a47b85 (patch) | |
tree | ef51a46d8ebbfa4300e6fa4f1c20b171b351bf13 /fs/fuse/inode.c | |
parent | a38fd8748464831584a19438cbb3082b5a2dab15 (diff) | |
download | linux-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/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index b0e18b470e91..b4b956da3851 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -350,7 +350,7 @@ retry: inode->i_generation = generation; fuse_init_inode(inode, attr); unlock_new_inode(inode); - } else if ((inode->i_mode ^ attr->mode) & S_IFMT) { + } else if (inode_wrong_type(inode, attr->mode)) { /* Inode has changed type, any I/O on the old should fail */ fuse_make_bad(inode); iput(inode); |