aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_ag.h2
-rw-r--r--fs/xfs/xfs_alloc.c17
2 files changed, 8 insertions, 11 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index 9381b0360c4..61b292a9fb4 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -193,7 +193,7 @@ typedef struct xfs_perag
193 xfs_agino_t pagi_count; /* number of allocated inodes */ 193 xfs_agino_t pagi_count; /* number of allocated inodes */
194 int pagb_count; /* pagb slots in use */ 194 int pagb_count; /* pagb slots in use */
195#ifdef __KERNEL__ 195#ifdef __KERNEL__
196 lock_t pagb_lock; /* lock for pagb_list */ 196 spinlock_t pagb_lock; /* lock for pagb_list */
197#endif 197#endif
198 xfs_perag_busy_t *pagb_list; /* unstable blocks */ 198 xfs_perag_busy_t *pagb_list; /* unstable blocks */
199 atomic_t pagf_fstrms; /* # of filestreams active in this AG */ 199 atomic_t pagf_fstrms; /* # of filestreams active in this AG */
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 012a649a19c..c23fb2aaa33 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -2500,10 +2500,9 @@ xfs_alloc_mark_busy(xfs_trans_t *tp,
2500 xfs_mount_t *mp; 2500 xfs_mount_t *mp;
2501 xfs_perag_busy_t *bsy; 2501 xfs_perag_busy_t *bsy;
2502 int n; 2502 int n;
2503 SPLDECL(s);
2504 2503
2505 mp = tp->t_mountp; 2504 mp = tp->t_mountp;
2506 s = mutex_spinlock(&mp->m_perag[agno].pagb_lock); 2505 spin_lock(&mp->m_perag[agno].pagb_lock);
2507 2506
2508 /* search pagb_list for an open slot */ 2507 /* search pagb_list for an open slot */
2509 for (bsy = mp->m_perag[agno].pagb_list, n = 0; 2508 for (bsy = mp->m_perag[agno].pagb_list, n = 0;
@@ -2533,7 +2532,7 @@ xfs_alloc_mark_busy(xfs_trans_t *tp,
2533 xfs_trans_set_sync(tp); 2532 xfs_trans_set_sync(tp);
2534 } 2533 }
2535 2534
2536 mutex_spinunlock(&mp->m_perag[agno].pagb_lock, s); 2535 spin_unlock(&mp->m_perag[agno].pagb_lock);
2537} 2536}
2538 2537
2539void 2538void
@@ -2543,11 +2542,10 @@ xfs_alloc_clear_busy(xfs_trans_t *tp,
2543{ 2542{
2544 xfs_mount_t *mp; 2543 xfs_mount_t *mp;
2545 xfs_perag_busy_t *list; 2544 xfs_perag_busy_t *list;
2546 SPLDECL(s);
2547 2545
2548 mp = tp->t_mountp; 2546 mp = tp->t_mountp;
2549 2547
2550 s = mutex_spinlock(&mp->m_perag[agno].pagb_lock); 2548 spin_lock(&mp->m_perag[agno].pagb_lock);
2551 list = mp->m_perag[agno].pagb_list; 2549 list = mp->m_perag[agno].pagb_list;
2552 2550
2553 ASSERT(idx < XFS_PAGB_NUM_SLOTS); 2551 ASSERT(idx < XFS_PAGB_NUM_SLOTS);
@@ -2559,7 +2557,7 @@ xfs_alloc_clear_busy(xfs_trans_t *tp,
2559 TRACE_UNBUSY("xfs_alloc_clear_busy", "missing", agno, idx, tp); 2557 TRACE_UNBUSY("xfs_alloc_clear_busy", "missing", agno, idx, tp);
2560 } 2558 }
2561 2559
2562 mutex_spinunlock(&mp->m_perag[agno].pagb_lock, s); 2560 spin_unlock(&mp->m_perag[agno].pagb_lock);
2563} 2561}
2564 2562
2565 2563
@@ -2578,11 +2576,10 @@ xfs_alloc_search_busy(xfs_trans_t *tp,
2578 xfs_agblock_t uend, bend; 2576 xfs_agblock_t uend, bend;
2579 xfs_lsn_t lsn; 2577 xfs_lsn_t lsn;
2580 int cnt; 2578 int cnt;
2581 SPLDECL(s);
2582 2579
2583 mp = tp->t_mountp; 2580 mp = tp->t_mountp;
2584 2581
2585 s = mutex_spinlock(&mp->m_perag[agno].pagb_lock); 2582 spin_lock(&mp->m_perag[agno].pagb_lock);
2586 cnt = mp->m_perag[agno].pagb_count; 2583 cnt = mp->m_perag[agno].pagb_count;
2587 2584
2588 uend = bno + len - 1; 2585 uend = bno + len - 1;
@@ -2615,12 +2612,12 @@ xfs_alloc_search_busy(xfs_trans_t *tp,
2615 if (cnt) { 2612 if (cnt) {
2616 TRACE_BUSYSEARCH("xfs_alloc_search_busy", "found", agno, bno, len, n, tp); 2613 TRACE_BUSYSEARCH("xfs_alloc_search_busy", "found", agno, bno, len, n, tp);
2617 lsn = bsy->busy_tp->t_commit_lsn; 2614 lsn = bsy->busy_tp->t_commit_lsn;
2618 mutex_spinunlock(&mp->m_perag[agno].pagb_lock, s); 2615 spin_unlock(&mp->m_perag[agno].pagb_lock);
2619 xfs_log_force(mp, lsn, XFS_LOG_FORCE|XFS_LOG_SYNC); 2616 xfs_log_force(mp, lsn, XFS_LOG_FORCE|XFS_LOG_SYNC);
2620 } else { 2617 } else {
2621 TRACE_BUSYSEARCH("xfs_alloc_search_busy", "not-found", agno, bno, len, n, tp); 2618 TRACE_BUSYSEARCH("xfs_alloc_search_busy", "not-found", agno, bno, len, n, tp);
2622 n = -1; 2619 n = -1;
2623 mutex_spinunlock(&mp->m_perag[agno].pagb_lock, s); 2620 spin_unlock(&mp->m_perag[agno].pagb_lock);
2624 } 2621 }
2625 2622
2626 return n; 2623 return n;