Skip to content

Commit f6369ae

Browse files
YuezhangMonamjaejeon
authored andcommitted
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>
1 parent a36e0ab commit f6369ae

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

fs/exfat/exfat_fs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#define EXFAT_ROOT_INO 1
1616

17-
#define EXFAT_CLUSTERS_UNTRACKED (~0u)
18-
1917
/*
2018
* exfat error flags
2119
*/

fs/exfat/super.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf)
6767
struct exfat_sb_info *sbi = EXFAT_SB(sb);
6868
unsigned long long id = huge_encode_dev(sb->s_bdev->bd_dev);
6969

70-
if (sbi->used_clusters == EXFAT_CLUSTERS_UNTRACKED) {
71-
mutex_lock(&sbi->s_lock);
72-
if (exfat_count_used_clusters(sb, &sbi->used_clusters)) {
73-
mutex_unlock(&sbi->s_lock);
74-
return -EIO;
75-
}
76-
mutex_unlock(&sbi->s_lock);
77-
}
78-
7970
buf->f_type = sb->s_magic;
8071
buf->f_bsize = sbi->cluster_size;
8172
buf->f_blocks = sbi->num_clusters - 2; /* clu 0 & 1 */
@@ -531,7 +522,6 @@ static int exfat_read_boot_sector(struct super_block *sb)
531522
sbi->vol_flags = le16_to_cpu(p_boot->vol_flags);
532523
sbi->vol_flags_persistent = sbi->vol_flags & (VOLUME_DIRTY | MEDIA_FAILURE);
533524
sbi->clu_srch_ptr = EXFAT_FIRST_CLUSTER;
534-
sbi->used_clusters = EXFAT_CLUSTERS_UNTRACKED;
535525

536526
/* check consistencies */
537527
if ((u64)sbi->num_FAT_sectors << p_boot->sect_size_bits <

0 commit comments

Comments
 (0)