mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
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>
This commit is contained in:
parent
afb6ffa33d
commit
6d0b7f873b
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue