Since exfat_ent_get support cache buffer head, let's apply it to
exfat_find_last_cluster.
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_chain,
unsigned int *ret_clu)
{
+ struct buffer_head *bh = NULL;
unsigned int clu, next;
unsigned int count = 0;
do {
count++;
clu = next;
- if (exfat_ent_get(sb, clu, &next, NULL))
+ if (exfat_ent_get(sb, clu, &next, &bh))
return -EIO;
} while (next != EXFAT_EOF_CLUSTER && count <= p_chain->size);
+ brelse(bh);
if (p_chain->size != count) {
exfat_fs_error(sb,
"bogus directory size (clus : ondisk(%d) != counted(%d))",