From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 271BC353EC0 for ; Mon, 15 Jun 2026 13:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781528916; cv=none; b=IWNskAObQ+JrouEFzyeQCbRix6rXAmu0WOYIZLnd2cHLPuJ6BiGQhVNNaDf1GpIJ4yVSIPbvFEkMD4OIG+NTvs5qhy6uFzvZpPjcof18NEpS6RZ5KkxyIehl/lnV3fAu/lqBpAB7QpjdB1UCLKO+OY1d0e6uAHRlHTa012M+D74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781528916; c=relaxed/simple; bh=RdFX5988xh3lBVRlc+B09VZMtQ0tk4JuK3ypbn84wMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ISTyIhM7Lc/dIXN1Y0jKSp1hGwkfSBBp9LMLJ8OfnjTyR1Hmv0+wRqrMI/d7AbgdbeuAKvFCN7muZ5SzTySn+9XGf62vDod9bHhaI4YTlpDovSNRnbSYalwAcKL+zR0w9k7jjah9jPF69yQ/zzMC17VhKQMG2HtD55o24Kscf2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y7hGr13S; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y7hGr13S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA1931F00A3D; Mon, 15 Jun 2026 13:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781528914; bh=Er4ZRBSGadaxynvYX+j+Eaq3Kuq2vlR4CBo1bDHaFf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y7hGr13SE1WIC9KM7M3RBd5TTyv7Q2juZT4L6St5Cs/jquRr3g2aL+n4bYNavS1sl IGd8Y3iYId9P1QRRjrkG9P3cj0Hqcg5Uzy0mA3Luw/vFRKXPDemGeXmHlivLAvPq6u IiDASs8JFDXNTt+a1PadYXUlKHb1K+ebwnGo4hc75BR3tX+UXSh04EH1z0cu5vnxyg V5zjebQ7wa1I9x432AfL3TkXp1+iSpDU3qLI/sf/TfQqJH1YdAjjunSXUCn71UonmN BHXomabidsFx6HEEmigEtjMRJdb7+WnLRtNRjlE5NsElJZcUp6OuDeP/wUb4GiAfE/ nrmaVmYCYuQMw== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 3/6] f2fs: avoid unnecessary sanity check on ckpt_valid_blocks Date: Mon, 15 Jun 2026 21:08:19 +0800 Message-ID: <20260615130822.2576088-3-chao@kernel.org> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog In-Reply-To: <20260615130822.2576088-1-chao@kernel.org> References: <20260615130822.2576088-1-chao@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The calculation of sec->ckpt_valid_blocks are the same in both set_ckpt_valid_blocks() and sanity_check_valid_blocks(), so it doesn't necessary to call sanity_check_valid_blocks() right after set_ckpt_valid_blocks(). Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1ef4edb77078..f9c688d270e6 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -4802,10 +4802,8 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) } /* update ckpt_valid_block */ - if (__is_large_section(sbi)) { + if (__is_large_section(sbi)) set_ckpt_valid_blocks(sbi, segno); - sanity_check_valid_blocks(sbi, segno); - } __clear_bit(segno, bitmap); sit_i->dirty_sentries--; @@ -5133,10 +5131,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) if (__is_large_section(sbi)) { unsigned int segno; - for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) { + for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) set_ckpt_valid_blocks(sbi, segno); - sanity_check_valid_blocks(sbi, segno); - } } if (err) -- 2.49.0