mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
exfat: improve exfat_count_num_clusters
Since exfat_ent_get support cache buffer head, let's apply it to exfat_count_num_clusters. 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
5cf0288f0d
commit
06805f4c57
|
|
@ -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 = EXFAT_SB(sb);
|
||||
struct buffer_head *bh = NULL;
|
||||
|
||||
if (!p_chain->dir || p_chain->dir == EXFAT_EOF_CLUSTER) {
|
||||
*ret_count = 0;
|
||||
|
|
@ -499,12 +500,13 @@ int exfat_count_num_clusters(struct super_block *sb,
|
|||
count = 0;
|
||||
for (i = 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 == EXFAT_EOF_CLUSTER)
|
||||
break;
|
||||
}
|
||||
|
||||
brelse(bh);
|
||||
*ret_count = count;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user