diff options
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index a1ca9c2b8c00..7ef25588062f 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -640,9 +640,10 @@ xfs_fs_counts( | |||
640 | xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT); | 640 | xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT); |
641 | cnt->allocino = percpu_counter_read_positive(&mp->m_icount); | 641 | cnt->allocino = percpu_counter_read_positive(&mp->m_icount); |
642 | cnt->freeino = percpu_counter_read_positive(&mp->m_ifree); | 642 | cnt->freeino = percpu_counter_read_positive(&mp->m_ifree); |
643 | cnt->freedata = percpu_counter_read_positive(&mp->m_fdblocks) - | ||
644 | XFS_ALLOC_SET_ASIDE(mp); | ||
643 | 645 | ||
644 | spin_lock(&mp->m_sb_lock); | 646 | spin_lock(&mp->m_sb_lock); |
645 | cnt->freedata = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); | ||
646 | cnt->freertx = mp->m_sb.sb_frextents; | 647 | cnt->freertx = mp->m_sb.sb_frextents; |
647 | spin_unlock(&mp->m_sb_lock); | 648 | spin_unlock(&mp->m_sb_lock); |
648 | return 0; | 649 | return 0; |
@@ -717,7 +718,8 @@ retry: | |||
717 | } else { | 718 | } else { |
718 | __int64_t free; | 719 | __int64_t free; |
719 | 720 | ||
720 | free = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); | 721 | free = percpu_counter_sum(&mp->m_fdblocks) - |
722 | XFS_ALLOC_SET_ASIDE(mp); | ||
721 | if (!free) | 723 | if (!free) |
722 | goto out; /* ENOSPC and fdblks_delta = 0 */ | 724 | goto out; /* ENOSPC and fdblks_delta = 0 */ |
723 | 725 | ||
@@ -756,8 +758,7 @@ out: | |||
756 | * the extra reserve blocks from the reserve..... | 758 | * the extra reserve blocks from the reserve..... |
757 | */ | 759 | */ |
758 | int error; | 760 | int error; |
759 | error = xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, | 761 | error = xfs_mod_fdblocks(mp, fdblks_delta, 0); |
760 | fdblks_delta, 0); | ||
761 | if (error == -ENOSPC) | 762 | if (error == -ENOSPC) |
762 | goto retry; | 763 | goto retry; |
763 | } | 764 | } |