From: "Tiezhu Yang" <kernelpatch@126.com>
To: jaegeuk@kernel.org, cm224.lee@samsung.com, chao2.yu@samsung.com
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] f2fs: optimize f2fs_write_cache_pages
Date: Fri, 17 Jul 2015 12:56:00 +0800 (CST) [thread overview]
Message-ID: <2f135856.6709.14e9a5e7d5a.Coremail.kernelpatch@126.com> (raw)
The if statement "goto continue_unlock" is exactly the same when
each if condition is true that is depended on the value of both
"step" and "is_cold_data(page)" are 0 or 1. That means when the
value of "step" equals to "is_cold_data(page)", the if condition
is true and the if statement "goto continue_unlock" appears only
once, so it can be optimized to reduce the duplicated code.
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
---
fs/f2fs/data.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b621c08..0219bd0 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1214,9 +1214,7 @@ continue_unlock:
goto continue_unlock;
}
- if (step == 0 && !is_cold_data(page))
- goto continue_unlock;
- if (step == 1 && is_cold_data(page))
+ if (step == is_cold_data(page))
goto continue_unlock;
if (PageWriteback(page)) {
--
1.8.3.1
reply other threads:[~2015-07-17 4:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=2f135856.6709.14e9a5e7d5a.Coremail.kernelpatch@126.com \
--to=kernelpatch@126.com \
--cc=chao2.yu@samsung.com \
--cc=cm224.lee@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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).