[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260108074929.356683-10-chizhiling@163.com>
Date: Thu, 8 Jan 2026 15:49:25 +0800
From: Chi Zhiling <chizhiling@....com>
To: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Namjae Jeon <linkinjeon@...nel.org>,
Sungjong Seo <sj1557.seo@...sung.com>,
Yuezhang Mo <yuezhang.mo@...y.com>,
Chi Zhiling <chizhiling@...inos.cn>,
Yuezhang Mo <Yuezhang.Mo@...y.com>
Subject: [PATCH v2 09/13] exfat: remove handling of non-file types in exfat_map_cluster
From: Chi Zhiling <chizhiling@...inos.cn>
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@...y.com>
Signed-off-by: Chi Zhiling <chizhiling@...inos.cn>
---
fs/exfat/inode.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 55984585526e..b714d242b238 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -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) {
--
2.43.0
Powered by blists - more mailing lists