summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChi Zhiling <chizhiling@kylinos.cn>2026-01-14 15:12:44 +0300
committerNamjae Jeon <linkinjeon@kernel.org>2026-02-12 15:21:50 +0300
commit6d0b7f873bbd153f6ce26a87ffa32238693e36a0 (patch)
treed458e3f075d4cc4cbf500e6ff709313da6da427e
parentafb6ffa33dab9622f7502c081b17dbc9bc9a97d0 (diff)
downloadlinux-6d0b7f873bbd153f6ce26a87ffa32238693e36a0.tar.xz
exfat: reuse cache to improve exfat_get_cluster
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 <chizhiling@kylinos.cn> Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
-rw-r--r--fs/exfat/cache.c4
1 files changed, 3 insertions, 1 deletions
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 = inode->i_sb;
struct exfat_inode_info *ei = EXFAT_I(inode);
+ struct buffer_head *bh = NULL;
struct exfat_cache_id cid;
unsigned int content, fclus;
@@ -265,7 +266,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int cluster,
return 0;
while (fclus < cluster) {
- if (exfat_ent_get(sb, *dclus, &content, NULL))
+ if (exfat_ent_get(sb, *dclus, &content, &bh))
return -EIO;
*last_dclus = *dclus;
@@ -279,6 +280,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int cluster,
cache_init(&cid, fclus, *dclus);
}
+ brelse(bh);
exfat_cache_add(inode, &cid);
return 0;
}