aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 0aa4428bfa31..049147776ee1 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1086,6 +1086,7 @@ xfs_fs_statfs(
1086 struct xfs_inode *ip = XFS_I(dentry->d_inode); 1086 struct xfs_inode *ip = XFS_I(dentry->d_inode);
1087 __uint64_t fakeinos, id; 1087 __uint64_t fakeinos, id;
1088 __uint64_t icount; 1088 __uint64_t icount;
1089 __uint64_t ifree;
1089 xfs_extlen_t lsize; 1090 xfs_extlen_t lsize;
1090 __int64_t ffree; 1091 __int64_t ffree;
1091 1092
@@ -1098,6 +1099,7 @@ xfs_fs_statfs(
1098 1099
1099 xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT); 1100 xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT);
1100 icount = percpu_counter_sum(&mp->m_icount); 1101 icount = percpu_counter_sum(&mp->m_icount);
1102 ifree = percpu_counter_sum(&mp->m_ifree);
1101 1103
1102 spin_lock(&mp->m_sb_lock); 1104 spin_lock(&mp->m_sb_lock);
1103 statp->f_bsize = sbp->sb_blocksize; 1105 statp->f_bsize = sbp->sb_blocksize;
@@ -1118,7 +1120,7 @@ xfs_fs_statfs(
1118 sbp->sb_icount); 1120 sbp->sb_icount);
1119 1121
1120 /* make sure statp->f_ffree does not underflow */ 1122 /* make sure statp->f_ffree does not underflow */
1121 ffree = statp->f_files - (icount - sbp->sb_ifree); 1123 ffree = statp->f_files - (icount - ifree);
1122 statp->f_ffree = max_t(__int64_t, ffree, 0); 1124 statp->f_ffree = max_t(__int64_t, ffree, 0);
1123 1125
1124 spin_unlock(&mp->m_sb_lock); 1126 spin_unlock(&mp->m_sb_lock);