diff options
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 30a5781a46d4..3bed0cf0d8af 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -543,11 +543,8 @@ xfs_readsb(xfs_mount_t *mp, int flags) | |||
543 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 543 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); |
544 | } | 544 | } |
545 | 545 | ||
546 | xfs_icsb_lock(mp); | 546 | /* Initialize per-cpu counters */ |
547 | xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); | 547 | xfs_icsb_reinit_counters(mp); |
548 | xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); | ||
549 | xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); | ||
550 | xfs_icsb_unlock(mp); | ||
551 | 548 | ||
552 | mp->m_sb_bp = bp; | 549 | mp->m_sb_bp = bp; |
553 | xfs_buf_relse(bp); | 550 | xfs_buf_relse(bp); |
@@ -1811,6 +1808,22 @@ xfs_icsb_init_counters( | |||
1811 | return 0; | 1808 | return 0; |
1812 | } | 1809 | } |
1813 | 1810 | ||
1811 | void | ||
1812 | xfs_icsb_reinit_counters( | ||
1813 | xfs_mount_t *mp) | ||
1814 | { | ||
1815 | xfs_icsb_lock(mp); | ||
1816 | /* | ||
1817 | * start with all counters disabled so that the | ||
1818 | * initial balance kicks us off correctly | ||
1819 | */ | ||
1820 | mp->m_icsb_counters = -1; | ||
1821 | xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); | ||
1822 | xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); | ||
1823 | xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); | ||
1824 | xfs_icsb_unlock(mp); | ||
1825 | } | ||
1826 | |||
1814 | STATIC void | 1827 | STATIC void |
1815 | xfs_icsb_destroy_counters( | 1828 | xfs_icsb_destroy_counters( |
1816 | xfs_mount_t *mp) | 1829 | xfs_mount_t *mp) |