new helper: inode_wrong_type()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 2 Mar 2021 01:37:10 +0000 (20:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Sep 2021 06:49:01 +0000 (08:49 +0200)
commit40ba433a85dbbf5b2e58f2ac6b161ce37ac872fc
tree841eff9e26bce82bf4111c4c4f0ca748660fc7f6
parentded9137fcf0d729dbe65aa98c411352f40b22970
new helper: inode_wrong_type()

commit 6e3e2c4362e41a2f18e3f7a5ad81bd2f49a47b85 upstream.

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>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/cifs/inode.c
fs/fuse/dir.c
fs/fuse/inode.c
fs/fuse/readdir.c
fs/nfs/inode.c
fs/nfsd/nfsproc.c
fs/overlayfs/namei.c
include/linux/fs.h