From nobody Mon Feb 9 03:12:02 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.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 4B48237E2EF; Thu, 8 Jan 2026 07:50:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767858651; cv=none; b=cTnFAnaPOe/tiZGyqfn5uJmTJlfHRSlGIXHrjYi11OUiFr37V7m9E5UjeQ0AakZHa4zsPEPxHv4HDSE8xCWVfTaZgYCxwYM0+boHeyNNolflJ3xCBEriljF+/+4D+lYDvRyi3DjdzOsxYOarSgnlxMFxpDVhynvebFHTs6LSwkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767858651; c=relaxed/simple; bh=RopLWtVceLC7tS2lI+xLxV4kiKSasNVefJ1AW0lNyQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPGCp1zBzSKVBNTSefPZ/lYC5X+Vts75nWvxTpkUxz76UVGIrErHtVjN2lzIRZb/yRU+CpbVlVgIA3WSX2hks70PXnBMbgTp5XRFD2gZvUG77P6Y5bhjgV+fBuY6Q4UjOtlAWm7FYF5UkX7e9YMeRrUgJlinL6//Q4o98hleXNk= 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=MZlA+mpt; arc=none smtp.client-ip=220.197.31.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="MZlA+mpt" 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=Bn zvrHIhkgHewKuMTs6hq6c/gumgF+tqmP1yexiiRwo=; b=MZlA+mptqERJh8hjMd Tu8hQ+VQdOSMHBGPwe47XJJ48PDCr/QTx+zAUQxYfKYepSMAQ/B/nZCC+qjBabvA knWQvGb/z2D2bxNETtBtPUjqrx6JEfqasYHh6qE9QIQZoMks9K0FFVAgHkr26yNK bZCwrJbWxelEhTo+Il391VV8s= Received: from czl-ubuntu-pc.. (unknown []) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wBH6+WpYV9pdSx_Eg--.889S10; Thu, 08 Jan 2026 15:50:08 +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 Subject: [PATCH v2 08/13] exfat: reuse cache to improve exfat_get_cluster Date: Thu, 8 Jan 2026 15:49:24 +0800 Message-ID: <20260108074929.356683-9-chizhiling@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108074929.356683-1-chizhiling@163.com> References: <20260108074929.356683-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: _____wBH6+WpYV9pdSx_Eg--.889S10 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw4UArW7KFy7Aw43XFy3XFb_yoWkKrc_Ww 1v9rWjgryYqa1fKrsrCw43KFZa9a18Cr1jkr1xAF17X39rJrZ3AF1DZasFyrW7Kr4fGF9x ZrWktrn3t3W0kjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0ebyJUUUUU== X-CM-SenderInfo: hfkl6xxlol0wi6rwjhhfrp/xtbC+BC2VGlfYbBpTAAA3I Content-Type: text/plain; charset="utf-8" From: Chi Zhiling Since exfat_ent_get supports cache buffer head, we can use this option to reduce sb_bread calls when fetching consecutive entries. Signed-off-by: Chi Zhiling --- fs/exfat/cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/exfat/cache.c b/fs/exfat/cache.c index b806e7f5b00f..025b39b7a9ac 100644 --- a/fs/exfat/cache.c +++ b/fs/exfat/cache.c @@ -238,6 +238,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int= cluster, { struct super_block *sb =3D inode->i_sb; struct exfat_inode_info *ei =3D EXFAT_I(inode); + struct buffer_head *bh =3D NULL; struct exfat_cache_id cid; unsigned int content, fclus; =20 @@ -265,7 +266,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int= cluster, return 0; =20 while (fclus < cluster) { - if (exfat_ent_get(sb, *dclus, &content, NULL)) + if (exfat_ent_get(sb, *dclus, &content, &bh)) return -EIO; =20 *last_dclus =3D *dclus; @@ -279,6 +280,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int= cluster, cache_init(&cid, fclus, *dclus); } =20 + brelse(bh); exfat_cache_add(inode, &cid); return 0; } --=20 2.43.0