Re: [PATCH v1 6/9] exfat: remove unused parameters from exfat_get_cluster
From: Yuezhang.Mo@xxxxxxxx
Date: Tue Dec 30 2025 - 04:24:19 EST
> diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
> index f9501c3a3666..1062ce470cb1 100644
> --- a/fs/exfat/inode.c
> +++ b/fs/exfat/inode.c
> @@ -157,28 +157,26 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
> *clu += clu_offset;
> }
> } else if (ei->type == TYPE_FILE) {
> - unsigned int fclus = 0;
> int err = exfat_get_cluster(inode, clu_offset,
> - &fclus, clu, &last_clu, 1);
> + clu, &last_clu);
> if (err)
> return -EIO;
> -
> - clu_offset -= fclus;
> } else {
> + unsigned int fclus = 0;
> /* hint information */
> if (clu_offset > 0 && ei->hint_bmap.off != EXFAT_EOF_CLUSTER &&
> ei->hint_bmap.off > 0 && clu_offset >= ei->hint_bmap.off) {
> - clu_offset -= ei->hint_bmap.off;
> /* hint_bmap.clu should be valid */
> WARN_ON(ei->hint_bmap.clu < 2);
> + fclus = ei->hint_bmap.off;
> *clu = ei->hint_bmap.clu;
> }
>
> - while (clu_offset > 0 && *clu != EXFAT_EOF_CLUSTER) {
> + while (fclus < clu_offset && *clu != EXFAT_EOF_CLUSTER) {
> last_clu = *clu;
> if (exfat_get_next_cluster(sb, clu))
> return -EIO;
> - clu_offset--;
> + fclus++;
> }
exfat_map_cluster() is only used for files. The code in this 'else' block is never executed and
can be cleaned up.
> }