From: Yuezhang Mo Date: Mon, 6 Feb 2023 10:25:20 +0000 (+0800) Subject: exfat: remove unneeded code from exfat_alloc_cluster() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8d2909eeca5ef41f64365f700b1fdde361086609;p=linux.git exfat: remove unneeded code from exfat_alloc_cluster() In the removed code, num_clusters is 0, nothing is done in exfat_chain_cont_cluster(), so it is unneeded, remove it. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon --- diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 41ae4cce1f420..65a8c9fb072c4 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -347,14 +347,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, exfat_err(sb, "hint_cluster is invalid (%u)", hint_clu); hint_clu = EXFAT_FIRST_CLUSTER; - if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { - if (exfat_chain_cont_cluster(sb, p_chain->dir, - num_clusters)) { - ret = -EIO; - goto unlock; - } - p_chain->flags = ALLOC_FAT_CHAIN; - } + p_chain->flags = ALLOC_FAT_CHAIN; } p_chain->dir = EXFAT_EOF_CLUSTER;