Skip to content

Commit 88a936b

Browse files
Chi Zhilingnamjaejeon
authored andcommitted
exfat: remove handling of non-file types in exfat_map_cluster
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>
1 parent 6d0b7f8 commit 88a936b

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

fs/exfat/inode.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,27 +156,11 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
156156
else
157157
*clu += clu_offset;
158158
}
159-
} else if (ei->type == TYPE_FILE) {
159+
} else {
160160
int err = exfat_get_cluster(inode, clu_offset,
161161
clu, &last_clu);
162162
if (err)
163163
return -EIO;
164-
} else {
165-
/* hint information */
166-
if (clu_offset > 0 && ei->hint_bmap.off != EXFAT_EOF_CLUSTER &&
167-
ei->hint_bmap.off > 0 && clu_offset >= ei->hint_bmap.off) {
168-
clu_offset -= ei->hint_bmap.off;
169-
/* hint_bmap.clu should be valid */
170-
WARN_ON(ei->hint_bmap.clu < 2);
171-
*clu = ei->hint_bmap.clu;
172-
}
173-
174-
while (clu_offset > 0 && *clu != EXFAT_EOF_CLUSTER) {
175-
last_clu = *clu;
176-
if (exfat_get_next_cluster(sb, clu))
177-
return -EIO;
178-
clu_offset--;
179-
}
180164
}
181165

182166
if (*clu == EXFAT_EOF_CLUSTER) {

0 commit comments

Comments
 (0)