Commit e5b30416 authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o

ext4: remove unneeded test of ret variable

Currently in ext4_fallocate() and ext4_zero_range() we're testing ret
variable along with new_size. However in ext4_fallocate() we just tested
ret before and in ext4_zero_range() if will always be zero when we get
there so there is no need to test it in both cases.
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent e04027e8
...@@ -4816,12 +4816,12 @@ static long ext4_zero_range(struct file *file, loff_t offset, ...@@ -4816,12 +4816,12 @@ static long ext4_zero_range(struct file *file, loff_t offset,
inode->i_mtime = inode->i_ctime = ext4_current_time(inode); inode->i_mtime = inode->i_ctime = ext4_current_time(inode);
if (!ret && new_size) { if (new_size) {
if (new_size > i_size_read(inode)) if (new_size > i_size_read(inode))
i_size_write(inode, new_size); i_size_write(inode, new_size);
if (new_size > EXT4_I(inode)->i_disksize) if (new_size > EXT4_I(inode)->i_disksize)
ext4_update_i_disksize(inode, new_size); ext4_update_i_disksize(inode, new_size);
} else if (!ret && !new_size) { } else {
/* /*
* Mark that we allocate beyond EOF so the subsequent truncate * Mark that we allocate beyond EOF so the subsequent truncate
* can proceed even if the new size is the same as i_size. * can proceed even if the new size is the same as i_size.
...@@ -4923,14 +4923,14 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) ...@@ -4923,14 +4923,14 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
tv = inode->i_ctime = ext4_current_time(inode); tv = inode->i_ctime = ext4_current_time(inode);
if (!ret && new_size) { if (new_size) {
if (new_size > i_size_read(inode)) { if (new_size > i_size_read(inode)) {
i_size_write(inode, new_size); i_size_write(inode, new_size);
inode->i_mtime = tv; inode->i_mtime = tv;
} }
if (new_size > EXT4_I(inode)->i_disksize) if (new_size > EXT4_I(inode)->i_disksize)
ext4_update_i_disksize(inode, new_size); ext4_update_i_disksize(inode, new_size);
} else if (!ret && !new_size) { } else {
/* /*
* Mark that we allocate beyond EOF so the subsequent truncate * Mark that we allocate beyond EOF so the subsequent truncate
* can proceed even if the new size is the same as i_size. * can proceed even if the new size is the same as i_size.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment