From nobody Mon Feb 9 12:24:18 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (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 A8E013815E8; Wed, 14 Jan 2026 12:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768392824; cv=none; b=dTNjD6wXOqsuM0+Qq4lq1eWBUPxXvS67hvO1w8RvR2vJA+xRGq3doLoj9fEqay3TqhiIJdCSxGCHlEcZtdnb4Fp9PCK8BoMLVXqSOIV7OdOvBDj13Kj0GciQehkCcdsFVQvD/KxwXDY3Q5Kv3VbR8nZf7OuNg5rd/X9D6z8OyDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768392824; c=relaxed/simple; bh=lZ9o5twc++xSajO9MlRYLn+/RHkWGVkj3/AO8HpzkXQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QaM1YYr3fsGbXadtrEte0nMLJG3D+KNYJmiAhgWZe1ArbzNbnqsC6IzFGHlkFsSFiRT9zY76+p8E4llpF6r70xdDJth8TiaY8zLI4t2gd2K8QnAmsREVJ5P/C1AKlMGE/H4EtV0UKOFkUgLJlky1z+oGLhXc++ZqE31/dXxtqlA= 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=YEbUg+24; arc=none smtp.client-ip=117.135.210.4 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="YEbUg+24" 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=DL +NcNIHLjMqkOTOK0OmVh7vEY80d2pJzl/dTNfgNAs=; b=YEbUg+24uV7pMO3E2W 7iCjVyZOwasz+Di9Ml2MQCbB1fQFW3e0vRkcQEDZcIDOESIT61lBNqW+CIamAvPG SuROdLZUECobKSjtOc0APyhijdDYdiVIUKgp6cwRq01Dn09dKo8C44viyi78Q1o1 TX36JGAnrLZ6vOd1YNeLtdJoU= Received: from czl-ubuntu-pc.. (unknown []) by gzga-smtp-mtada-g1-3 (Coremail) with SMTP id _____wAXybtbiGdpFdouGQ--.5056S5; Wed, 14 Jan 2026 20:13:18 +0800 (CST) From: Chi Zhiling To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Namjae Jeon , Sungjong Seo , Yuezhang Mo , Chi Zhiling , Yuezhang Mo Subject: [PATCH v3 03/13] exfat: improve exfat_count_num_clusters Date: Wed, 14 Jan 2026 20:12:39 +0800 Message-ID: <20260114121250.615064-4-chizhiling@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114121250.615064-1-chizhiling@163.com> References: <20260114121250.615064-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: _____wAXybtbiGdpFdouGQ--.5056S5 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw4UAryfAFWDJr17Jr43ZFb_yoWkGwb_CF 1IvryDWr4jyF1Syr1vk3yakFy2qa1xCrWqvrW2yFyDW3s8JrW7XFyUXFy7Cws2krsrJr98 ArZ3Arn3Ga10yjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0l_M7UUUUU== X-CM-SenderInfo: hfkl6xxlol0wi6rwjhhfrp/xtbC9x5tC2lniF56WwAA32 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 Reviewed-by: Yuezhang Mo --- 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