From patchwork Fri Feb 27 08:52:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 5899581 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A395D9F373 for ; Fri, 27 Feb 2015 09:11:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E49B220165 for ; Fri, 27 Feb 2015 09:11:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01EFA20155 for ; Fri, 27 Feb 2015 09:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754695AbbB0JLb (ORCPT ); Fri, 27 Feb 2015 04:11:31 -0500 Received: from mga11.intel.com ([192.55.52.93]:17552 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754788AbbB0JL3 (ORCPT ); Fri, 27 Feb 2015 04:11:29 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 27 Feb 2015 01:11:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,658,1418112000"; d="scan'208";a="533634505" Received: from kernel.bj.intel.com ([10.238.154.97]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2015 01:01:57 -0800 From: Wanpeng Li To: Jaegeuk Kim Cc: Changman Lee , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH] f2fs: don't need to collect dirty sit entries and flush journal when there's no dirty sit entries Date: Fri, 27 Feb 2015 16:52:50 +0800 Message-Id: <1425027170-21093-1-git-send-email-wanpeng.li@linux.intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Don't need to collect dirty sit entries and flush sit journal to sit entries when there's no dirty sit entries. This patch check dirty_sentries earlier just like flush_nat_entries. Signed-off-by: Wanpeng Li Reviewed-by: Chao Yu --- fs/f2fs/segment.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index daee4ab..e7b83b6 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1730,6 +1730,9 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) mutex_lock(&curseg->curseg_mutex); mutex_lock(&sit_i->sentry_lock); + if (!sit_i->dirty_sentries) + goto out; + /* * add and account sit entries of dirty bitmap in sit entry * set temporarily @@ -1744,9 +1747,6 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) if (!__has_cursum_space(sum, sit_i->dirty_sentries, SIT_JOURNAL)) remove_sits_in_journal(sbi); - if (!sit_i->dirty_sentries) - goto out; - /* * there are two steps to flush sit entries: * #1, flush sit entries to journal in current cold data summary block.