diff options
author | Eric Biggers <ebiggers@google.com> | 2019-12-31 19:04:39 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-01-17 22:24:54 +0100 |
commit | a1180994f52c0867c134e411a6a532ffa166ceac (patch) | |
tree | 85e4aeb41710cf3234f9339812100851b4d7f531 /fs/ext4/inode.c | |
parent | ext4: clean up len and offset checks in ext4_fallocate() (diff) | |
download | linux-a1180994f52c0867c134e411a6a532ffa166ceac.tar.xz linux-a1180994f52c0867c134e411a6a532ffa166ceac.zip |
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>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 73482fc86561..3d0efb452eb8 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3940,9 +3940,6 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) unsigned int credits; int ret = 0; - if (!S_ISREG(inode->i_mode)) - return -EOPNOTSUPP; - trace_ext4_punch_hole(inode, offset, length, 0); ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); |