Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754593AbbLADoA (ORCPT ); Mon, 30 Nov 2015 22:44:00 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:51139 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbbLADn6 (ORCPT ); Mon, 30 Nov 2015 22:43:58 -0500 X-AuditID: cbfee61b-f793c6d00000236c-41-565d1774fa2a From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] f2fs: clean up code with __has_cursum_space Date: Tue, 01 Dec 2015 11:42:54 +0800 Message-id: <000201d12bea$7cdbdb60$76939220$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdEr6kJa4tmqOUijRmOI1YugsToT8g== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t9jAd0S8dgwg+WHLCyerJ/FbHFpkbvF 5V1z2ByYPTat6mTz2L3gM5PH501yAcxRXDYpqTmZZalF+nYJXBnreprYC/6zV3y/+I6lgXEf WxcjJ4eEgInEyr7/rBC2mMSFe+uB4lwcQgJLGSV+3X/PAuG8YpS4ueoWE0gVm4CKxPKO/2C2 CJB9aNFldhCbWcBDorHjO9gkYQEHid3/ToPFWQRUJea9XMsIYvMKWEr8mXOFFcIWlPgx+R4L RK+WxPqdx5kgbHmJzWveMkNcpCCx4+xrRohdehJn56yHqhGX2HjkFssERoFZSEbNQjJqFpJR s5C0LGBkWcUokVqQXFCclJ5rlJdarlecmFtcmpeul5yfu4kRHMbPpHcwHt7lfohRgINRiYf3 wKqYMCHWxLLiytxDjBIczEoivKt/A4V4UxIrq1KL8uOLSnNSiw8xSnOwKInz7rsUGSYkkJ5Y kpqdmlqQWgSTZeLglGpgzPzK8u+42MV3J0pLnsZWnV3zWrtesHT+3Ckv+CbdjQyNn8h9+Ux4 kNgkpXP3Fd+KPzJ9PfXbyUajU6IvkyudbL9olNiyTVgTkJ+sd3RdraSAWUX+m/NH765sfBR+ wj4n9MSy28Gb1HepPExMXRvEW6G0/NA+iU3zjhY5pFj/t4p+Oo/BW4B7jRJLcUaioRZzUXEi AJCHQtBfAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 36 Clean up codes in lookup_journal_in_cursum() with __has_cursum_space(). Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ed2c5de..74c4748 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1740,13 +1740,13 @@ int lookup_journal_in_cursum(struct f2fs_summary_block *sum, int type, if (le32_to_cpu(nid_in_journal(sum, i)) == val) return i; } - if (alloc && nats_in_cursum(sum) < NAT_JOURNAL_ENTRIES) + if (alloc && __has_cursum_space(sum, 1, NAT_JOURNAL)) return update_nats_in_cursum(sum, 1); } else if (type == SIT_JOURNAL) { for (i = 0; i < sits_in_cursum(sum); i++) if (le32_to_cpu(segno_in_journal(sum, i)) == val) return i; - if (alloc && sits_in_cursum(sum) < SIT_JOURNAL_ENTRIES) + if (alloc && __has_cursum_space(sum, 1, SIT_JOURNAL)) return update_sits_in_cursum(sum, 1); } return -1; -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/