summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuezhang Mo <Yuezhang.Mo@sony.com>2025-02-19 13:00:09 -0600
committerNamjae Jeon <linkinjeon@kernel.org>2025-03-27 21:18:02 +0900
commitf6369ae1f088cb6d18d7a07eec95d7c10c2a2a5e (patch)
tree35ab7963cb042f999c15f8267b529c234bb85764
parenta36e0ab44cb344728f7c0fdc34edcbae64739c16 (diff)
downloadlinux-f6369ae1f088cb6d18d7a07eec95d7c10c2a2a5e.tar.gz
linux-f6369ae1f088cb6d18d7a07eec95d7c10c2a2a5e.tar.bz2
linux-f6369ae1f088cb6d18d7a07eec95d7c10c2a2a5e.zip
exfat: remove count used cluster from exfat_statfs()
The callback function statfs() is called only after the file system is mounted. During the process of mounting the exFAT file system, the number of used clusters has been counted, so the condition "sbi->used_clusters == EXFAT_CLUSTERS_UNTRACKED" is always false and should be deleted. Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
-rw-r--r--fs/exfat/exfat_fs.h2
-rw-r--r--fs/exfat/super.c10
2 files changed, 0 insertions, 12 deletions
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index d30ce18a88b7..f8ead4d47ef0 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -14,8 +14,6 @@
#define EXFAT_ROOT_INO 1
-#define EXFAT_CLUSTERS_UNTRACKED (~0u)
-
/*
* exfat error flags
*/
diff --git a/fs/exfat/super.c b/fs/exfat/super.c
index bd57844414aa..8465033a6cf0 100644
--- a/fs/exfat/super.c
+++ b/fs/exfat/super.c
@@ -67,15 +67,6 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf)
struct exfat_sb_info *sbi = EXFAT_SB(sb);
unsigned long long id = huge_encode_dev(sb->s_bdev->bd_dev);
- if (sbi->used_clusters == EXFAT_CLUSTERS_UNTRACKED) {
- mutex_lock(&sbi->s_lock);
- if (exfat_count_used_clusters(sb, &sbi->used_clusters)) {
- mutex_unlock(&sbi->s_lock);
- return -EIO;
- }
- mutex_unlock(&sbi->s_lock);
- }
-
buf->f_type = sb->s_magic;
buf->f_bsize = sbi->cluster_size;
buf->f_blocks = sbi->num_clusters - 2; /* clu 0 & 1 */
@@ -531,7 +522,6 @@ static int exfat_read_boot_sector(struct super_block *sb)
sbi->vol_flags = le16_to_cpu(p_boot->vol_flags);
sbi->vol_flags_persistent = sbi->vol_flags & (VOLUME_DIRTY | MEDIA_FAILURE);
sbi->clu_srch_ptr = EXFAT_FIRST_CLUSTER;
- sbi->used_clusters = EXFAT_CLUSTERS_UNTRACKED;
/* check consistencies */
if ((u64)sbi->num_FAT_sectors << p_boot->sect_size_bits <