[RFC PATCH v1 1/6] exfat: remove dead hint_bmap updates in I/O and truncate paths

Chi Zhiling <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
From: Chi Zhiling <[email protected]>

hint_bmap is only consumed by exfat_readdir() during directory
iteration. exfat_map_cluster() runs on the file I/O path (via iomap)
and never reaches directory iteration, and __exfat_truncate() only
resets the hint when the inode is already being evicted, so drop
them along with the now-unused local_clu_offset.

Signed-off-by: Chi Zhiling <[email protected]>
---
 fs/exfat/file.c  | 4 ----
 fs/exfat/inode.c | 5 -----
 2 files changed, 9 deletions(-)

diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index a2a9ee1a2004..29c5db12288e 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -278,10 +278,6 @@ int __exfat_truncate(struct inode *inode)
 	/* clear exfat cache */
 	exfat_cache_inval_inode(inode);
 
-	/* hint information */
-	ei->hint_bmap.off = EXFAT_EOF_CLUSTER;
-	ei->hint_bmap.clu = EXFAT_EOF_CLUSTER;
-
 	/* hint_stat will be used if this is directory. */
 	ei->hint_stat.eidx = 0;
 	ei->hint_stat.clu = ei->start_clu;
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index ccd13630187e..d041f893b1c3 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -144,7 +144,6 @@ int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
 	struct super_block *sb = inode->i_sb;
 	struct exfat_sb_info *sbi = EXFAT_SB(sb);
 	struct exfat_inode_info *ei = EXFAT_I(inode);
-	unsigned int local_clu_offset = clu_offset;
 	unsigned int num_to_be_allocated = 0, num_clusters;
 
 	num_clusters = exfat_bytes_to_cluster(sbi, exfat_ondisk_size(inode));
@@ -234,10 +233,6 @@ int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
 			*balloc = true;
 	}
 
-	/* hint information */
-	ei->hint_bmap.off = local_clu_offset;
-	ei->hint_bmap.clu = *clu;
-
 	return 0;
 }
 
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.