From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: dan.carpenter@oracle.com, Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH 2/2] ext4: Remove unneeded test of ret variable
Date: Mon, 31 Mar 2014 11:11:34 +0200 [thread overview]
Message-ID: <1396257094-10386-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1396257094-10386-1-git-send-email-lczerner@redhat.com>
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: Lukas Czerner <lczerner@redhat.com>
---
fs/ext4/extents.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 491208c..8c09e1d 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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);
- if (!ret && new_size) {
+ if (new_size) {
if (new_size > i_size_read(inode))
i_size_write(inode, new_size);
if (new_size > EXT4_I(inode)->i_disksize)
ext4_update_i_disksize(inode, new_size);
- } else if (!ret && !new_size) {
+ } else {
/*
* Mark that we allocate beyond EOF so the subsequent truncate
* 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)
tv = inode->i_ctime = ext4_current_time(inode);
- if (!ret && new_size) {
+ if (new_size) {
if (new_size > i_size_read(inode)) {
i_size_write(inode, new_size);
inode->i_mtime = tv;
}
if (new_size > EXT4_I(inode)->i_disksize)
ext4_update_i_disksize(inode, new_size);
- } else if (!ret && !new_size) {
+ } else {
/*
* Mark that we allocate beyond EOF so the subsequent truncate
* can proceed even if the new size is the same as i_size.
--
1.8.3.1
next prev parent reply other threads:[~2014-03-31 9:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 9:11 [PATCH 1/2] ext4: Fix flag handling in ext4_split_convert_extents() Lukas Czerner
2014-03-31 9:11 ` Lukas Czerner [this message]
2014-04-01 5:00 ` [PATCH 2/2] ext4: Remove unneeded test of ret variable Theodore Ts'o
2014-03-31 14:12 ` [PATCH 1/2] ext4: Fix flag handling in ext4_split_convert_extents() Dmitry Monakhov
2014-03-31 14:19 ` Dan Carpenter
2014-04-01 4:57 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396257094-10386-2-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).