]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ext4: remove redundant S_ISREG() checks from ext4_fallocate()
authorEric Biggers <ebiggers@google.com>
Tue, 31 Dec 2019 18:04:39 +0000 (12:04 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jan 2020 21:24:54 +0000 (16:24 -0500)
commita1180994f52c0867c134e411a6a532ffa166ceac
tree85e4aeb41710cf3234f9339812100851b4d7f531
parent9b02e4987ab092caed8f3bccdacaef9acf9015dd
ext4: remove redundant S_ISREG() checks from ext4_fallocate()

ext4_fallocate() is only used in the file_operations for regular files.
Also, the VFS only allows fallocate() on regular files and block
devices, but block devices always use blkdev_fallocate().  For both of
these reasons, S_ISREG() is always true in ext4_fallocate().

Therefore the S_ISREG() checks in ext4_zero_range(),
ext4_collapse_range(), ext4_insert_range(), and ext4_punch_hole() are
redundant.  Remove them.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20191231180444.46586-4-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
fs/ext4/extents.c
fs/ext4/inode.c