Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756245AbbGQF25 (ORCPT ); Fri, 17 Jul 2015 01:28:57 -0400 Received: from m15-15.126.com ([220.181.15.15]:53905 "EHLO m15-15.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbbGQF24 (ORCPT ); Fri, 17 Jul 2015 01:28:56 -0400 X-Greylist: delayed 1899 seconds by postgrey-1.27 at vger.kernel.org; Fri, 17 Jul 2015 01:28:51 EDT X-Originating-IP: [113.200.155.184] Date: Fri, 17 Jul 2015 12:56:00 +0800 (CST) From: "Tiezhu Yang" 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 X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20150119(59087.7062) Copyright (c) 2002-2015 www.mailtech.cn 126com Content-Type: text/plain; charset=GBK MIME-Version: 1.0 Message-ID: <2f135856.6709.14e9a5e7d5a.Coremail.kernelpatch@126.com> X-CM-TRANSID: D8qowACn3fHhiqhVxlECAA--.1148W X-CM-SenderInfo: xnhu0vxosd3ubk6rjloofrz/1tbiWwQ69VPM9rbkDgACsn X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t6H5T3Yq015913 Content-Length: 1079 Lines: 29 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 --- 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????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?