From nobody Sat Feb 7 08:28:00 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (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 B6A2F31328B; Fri, 26 Dec 2025 09:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766742343; cv=none; b=LJGF6fnAfWHpRTbd35hEfWjGhGTzsOdVOU7h9tnoulhmliWiYj/vIABa46VyNQy+rAs02MBpstHeCPrtI/tZ9SR3RejB5K2JOCE94bJ43CDJQIYyGthlLW0KOYpTAJZXLyXCKpjbdoZnrXiuBnLovnxutt99koUsJTuddQZQk3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766742343; c=relaxed/simple; bh=QV3tmKsVrQB7Eux4rAx18e/5Tsm/yQOndaXeLh4Utr4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oV6FdbhuTUzOsaWCtXOObob97SONnCDo26CHBCFgoio4Ge4+UMkM4Y9D8TgN8NSz9kavMY9zhA2OGnSCwjwuZa10MJgDt51L/rLnx6DakyAm3BLh6/GR8w7mvUAQBwDJcz3xZv6JdPlMgfrAyJZaNuNiLqSUbL4LPK9SZ/r7H9U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=HPUT9OYH; arc=none smtp.client-ip=220.197.31.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="HPUT9OYH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=EB aNGS1nr6TdvpG1M4Ssyj0BII1bSbsHnPJMwETv0k0=; b=HPUT9OYHNiVpnPTy2+ pslvldUSba7jokGwmLsjkIQE/UUeZoGpxqrCKRtimFWz+11tVOhR79SFPIWuY+J8 SGF9+FSIyFry9OBw5qb7/4A+QAuPUe5p76Bel+i3Cm/bHXs9dxPng9ovesfqlyjh +a9tTTNb4DNZZPdZbK3eoY+V4= Received: from chi-Redmi-Book.. (unknown []) by gzsmtp5 (Coremail) with SMTP id QCgvCgCnlXIPWU5p9JFCJA--.53S6; Fri, 26 Dec 2025 17:44:52 +0800 (CST) From: Chi Zhiling To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Namjae Jeon , Sungjong Seo , Yuezhang Mo , Alexander Viro , Christian Brauner , Jan Kara , Matthew Wilcox , Chi Zhiling Subject: [PATCH v1 4/9] exfat: improve exfat_count_num_clusters Date: Fri, 26 Dec 2025 17:44:35 +0800 Message-ID: <20251226094440.455563-5-chizhiling@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251226094440.455563-1-chizhiling@163.com> References: <20251226094440.455563-1-chizhiling@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: QCgvCgCnlXIPWU5p9JFCJA--.53S6 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw4UAryfAw48WF4fGryxGrg_yoWDuFb_CF 1IvryDWr4jyF1Syr1vk3yakFy2qa1xCryqvrW2yFyDW34DJrW7XFWUXFy7CwsFkrsxJr98 JrZ3Arn3Ga10yjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbvtC3UUUUU== X-CM-SenderInfo: hfkl6xxlol0wi6rwjhhfrp/xtbC3BRJ5mlOWRS7wAAA32 Content-Type: text/plain; charset="utf-8" From: Chi Zhiling Since exfat_ent_get support cache buffer head, let's apply it to exfat_count_num_clusters. Signed-off-by: Chi Zhiling --- fs/exfat/fatent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 679688cfea01..f060eab2f2f2 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -484,6 +484,7 @@ int exfat_count_num_clusters(struct super_block *sb, unsigned int i, count; unsigned int clu; struct exfat_sb_info *sbi =3D EXFAT_SB(sb); + struct buffer_head *bh =3D NULL; =20 if (!p_chain->dir || p_chain->dir =3D=3D EXFAT_EOF_CLUSTER) { *ret_count =3D 0; @@ -499,12 +500,13 @@ int exfat_count_num_clusters(struct super_block *sb, count =3D 0; for (i =3D EXFAT_FIRST_CLUSTER; i < sbi->num_clusters; i++) { count++; - if (exfat_ent_get(sb, clu, &clu, NULL)) + if (exfat_ent_get(sb, clu, &clu, &bh)) return -EIO; if (clu =3D=3D EXFAT_EOF_CLUSTER) break; } =20 + brelse(bh); *ret_count =3D count; =20 /* --=20 2.43.0