|
|
| version 1.388, 2006/12/04 02:51:48 | version 1.389, 2006/12/11 14:47:25 |
|---|---|
| Line 543 xfs_readsb(xfs_mount_t *mp, int flags) | Line 543 xfs_readsb(xfs_mount_t *mp, int flags) |
| ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); |
| } | } |
| mutex_lock(&mp->m_icsb_mutex); | xfs_icsb_lock(mp); |
| xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); |
| xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); |
| xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| mp->m_sb_bp = bp; | mp->m_sb_bp = bp; |
| xfs_buf_relse(bp); | xfs_buf_relse(bp); |
| Line 1736 xfs_icsb_cpu_notify( | Line 1736 xfs_icsb_cpu_notify( |
| memset(cntp, 0, sizeof(xfs_icsb_cnts_t)); | memset(cntp, 0, sizeof(xfs_icsb_cnts_t)); |
| break; | break; |
| case CPU_ONLINE: | case CPU_ONLINE: |
| mutex_lock(&mp->m_icsb_mutex); | xfs_icsb_lock(mp); |
| xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_ICOUNT, 0, 0); |
| xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_IFREE, 0, 0); |
| xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); | xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, 0, 0); |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| break; | break; |
| case CPU_DEAD: | case CPU_DEAD: |
| /* Disable all the counters, then fold the dead cpu's | /* Disable all the counters, then fold the dead cpu's |
| * count into the total on the global superblock and | * count into the total on the global superblock and |
| * re-enable the counters. */ | * re-enable the counters. */ |
| mutex_lock(&mp->m_icsb_mutex); | xfs_icsb_lock(mp); |
| s = XFS_SB_LOCK(mp); | s = XFS_SB_LOCK(mp); |
| xfs_icsb_disable_counter(mp, XFS_SBS_ICOUNT); | xfs_icsb_disable_counter(mp, XFS_SBS_ICOUNT); |
| xfs_icsb_disable_counter(mp, XFS_SBS_IFREE); | xfs_icsb_disable_counter(mp, XFS_SBS_IFREE); |
| Line 1765 xfs_icsb_cpu_notify( | Line 1765 xfs_icsb_cpu_notify( |
| xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, | xfs_icsb_balance_counter(mp, XFS_SBS_FDBLOCKS, |
| XFS_ICSB_SB_LOCKED, 0); | XFS_ICSB_SB_LOCKED, 0); |
| XFS_SB_UNLOCK(mp, s); | XFS_SB_UNLOCK(mp, s); |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| break; | break; |
| } | } |
| Line 1813 xfs_icsb_destroy_counters( | Line 1813 xfs_icsb_destroy_counters( |
| unregister_hotcpu_notifier(&mp->m_icsb_notifier); | unregister_hotcpu_notifier(&mp->m_icsb_notifier); |
| free_percpu(mp->m_sb_cnts); | free_percpu(mp->m_sb_cnts); |
| } | } |
| mutex_destroy(&mp->m_icsb_mutex); | |
| } | } |
| STATIC_INLINE void | STATIC_INLINE void |
| Line 2156 slow_path: | Line 2157 slow_path: |
| * the superblock lock. We still need to hold the superblock | * the superblock lock. We still need to hold the superblock |
| * lock, however, when we modify the global structures. | * lock, however, when we modify the global structures. |
| */ | */ |
| mutex_lock(&mp->m_icsb_mutex); | xfs_icsb_lock(mp); |
| /* | /* |
| * Now running atomically. | * Now running atomically. |
| Line 2165 slow_path: | Line 2166 slow_path: |
| * Drop the lock and try again in the fast path.... | * Drop the lock and try again in the fast path.... |
| */ | */ |
| if (!(xfs_icsb_counter_disabled(mp, field))) { | if (!(xfs_icsb_counter_disabled(mp, field))) { |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| goto again; | goto again; |
| } | } |
| Line 2192 slow_path: | Line 2193 slow_path: |
| */ | */ |
| if (ret != ENOSPC) | if (ret != ENOSPC) |
| xfs_icsb_balance_counter(mp, field, 0, 0); | xfs_icsb_balance_counter(mp, field, 0, 0); |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| return ret; | return ret; |
| balance_counter: | balance_counter: |
| Line 2205 balance_counter: | Line 2206 balance_counter: |
| * do more balances than strictly necessary but it is not | * do more balances than strictly necessary but it is not |
| * the common slowpath case. | * the common slowpath case. |
| */ | */ |
| mutex_lock(&mp->m_icsb_mutex); | xfs_icsb_lock(mp); |
| /* | /* |
| * running atomically. | * running atomically. |
| Line 2216 balance_counter: | Line 2217 balance_counter: |
| * another balance operation being required. | * another balance operation being required. |
| */ | */ |
| xfs_icsb_balance_counter(mp, field, 0, delta); | xfs_icsb_balance_counter(mp, field, 0, delta); |
| mutex_unlock(&mp->m_icsb_mutex); | xfs_icsb_unlock(mp); |
| goto again; | goto again; |
| } | } |