]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
exfat: remove handling of non-file types in exfat_map_cluster
authorChi Zhiling <chizhiling@kylinos.cn>
Wed, 14 Jan 2026 12:12:45 +0000 (20:12 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Thu, 12 Feb 2026 12:21:50 +0000 (21:21 +0900)
Yuezhang said: "exfat_map_cluster() is only used for files. The code
in this 'else' block is never executed and can be cleaned up."

Suggested-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/inode.c

index 55984585526ef4747727393dca1186bec958fea5..b714d242b238f911f9193e22fdee32e2806c0eb2 100644 (file)
@@ -156,27 +156,11 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
                        else
                                *clu += clu_offset;
                }
-       } else if (ei->type == TYPE_FILE) {
+       } else {
                int err = exfat_get_cluster(inode, clu_offset,
                                clu, &last_clu);
                if (err)
                        return -EIO;
-       } else {
-               /* 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);
-                       *clu = ei->hint_bmap.clu;
-               }
-
-               while (clu_offset > 0 && *clu != EXFAT_EOF_CLUSTER) {
-                       last_clu = *clu;
-                       if (exfat_get_next_cluster(sb, clu))
-                               return -EIO;
-                       clu_offset--;
-               }
        }
 
        if (*clu == EXFAT_EOF_CLUSTER) {