Lines Matching refs:pag
24 struct xfs_perag *pag, in xfs_extent_busy_insert_list() argument
36 new->agno = pag->pag_agno; in xfs_extent_busy_insert_list()
43 trace_xfs_extent_busy(pag->pag_mount, pag->pag_agno, bno, len); in xfs_extent_busy_insert_list()
45 spin_lock(&pag->pagb_lock); in xfs_extent_busy_insert_list()
46 rbp = &pag->pagb_tree.rb_node; in xfs_extent_busy_insert_list()
63 rb_insert_color(&new->rb_node, &pag->pagb_tree); in xfs_extent_busy_insert_list()
67 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_insert_list()
73 struct xfs_perag *pag, in xfs_extent_busy_insert() argument
78 xfs_extent_busy_insert_list(pag, bno, len, flags, &tp->t_busy); in xfs_extent_busy_insert()
83 struct xfs_perag *pag, in xfs_extent_busy_insert_discard() argument
88 xfs_extent_busy_insert_list(pag, bno, len, XFS_EXTENT_BUSY_DISCARDED, in xfs_extent_busy_insert_discard()
104 struct xfs_perag *pag, in xfs_extent_busy_search() argument
113 spin_lock(&pag->pagb_lock); in xfs_extent_busy_search()
114 rbp = pag->pagb_tree.rb_node; in xfs_extent_busy_search()
133 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_search()
151 struct xfs_perag *pag, in xfs_extent_busy_update_extent() argument
155 bool userdata) __releases(&pag->pagb_lock) in xfs_extent_busy_update_extent()
156 __acquires(&pag->pagb_lock) in xfs_extent_busy_update_extent()
168 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_update_extent()
170 spin_lock(&pag->pagb_lock); in xfs_extent_busy_update_extent()
243 rb_erase(&busyp->rb_node, &pag->pagb_tree); in xfs_extent_busy_update_extent()
282 trace_xfs_extent_busy_reuse(mp, pag->pag_agno, fbno, flen); in xfs_extent_busy_update_extent()
286 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_update_extent()
288 trace_xfs_extent_busy_force(mp, pag->pag_agno, fbno, flen); in xfs_extent_busy_update_extent()
289 spin_lock(&pag->pagb_lock); in xfs_extent_busy_update_extent()
300 struct xfs_perag *pag, in xfs_extent_busy_reuse() argument
308 spin_lock(&pag->pagb_lock); in xfs_extent_busy_reuse()
310 rbp = pag->pagb_tree.rb_node; in xfs_extent_busy_reuse()
325 if (!xfs_extent_busy_update_extent(mp, pag, busyp, fbno, flen, in xfs_extent_busy_reuse()
329 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_reuse()
358 spin_lock(&args->pag->pagb_lock); in xfs_extent_busy_trim()
361 rbp = args->pag->pagb_tree.rb_node; in xfs_extent_busy_trim()
506 *busy_gen = args->pag->pagb_gen; in xfs_extent_busy_trim()
509 spin_unlock(&args->pag->pagb_lock); in xfs_extent_busy_trim()
523 struct xfs_perag *pag, in xfs_extent_busy_clear_one() argument
529 rb_erase(&busyp->rb_node, &pag->pagb_tree); in xfs_extent_busy_clear_one()
538 struct xfs_perag *pag, in xfs_extent_busy_put_pag() argument
540 __releases(pag->pagb_lock) in xfs_extent_busy_put_pag()
543 pag->pagb_gen++; in xfs_extent_busy_put_pag()
544 wake_up_all(&pag->pagb_wait); in xfs_extent_busy_put_pag()
547 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_put_pag()
548 xfs_perag_put(pag); in xfs_extent_busy_put_pag()
563 struct xfs_perag *pag = NULL; in xfs_extent_busy_clear() local
569 if (pag) in xfs_extent_busy_clear()
570 xfs_extent_busy_put_pag(pag, wakeup); in xfs_extent_busy_clear()
572 pag = xfs_perag_get(mp, agno); in xfs_extent_busy_clear()
573 spin_lock(&pag->pagb_lock); in xfs_extent_busy_clear()
581 xfs_extent_busy_clear_one(mp, pag, busyp); in xfs_extent_busy_clear()
586 if (pag) in xfs_extent_busy_clear()
587 xfs_extent_busy_put_pag(pag, wakeup); in xfs_extent_busy_clear()
607 struct xfs_perag *pag, in xfs_extent_busy_flush() argument
623 if (busy_gen != READ_ONCE(pag->pagb_gen)) in xfs_extent_busy_flush()
632 prepare_to_wait(&pag->pagb_wait, &wait, TASK_KILLABLE); in xfs_extent_busy_flush()
633 if (busy_gen != READ_ONCE(pag->pagb_gen)) in xfs_extent_busy_flush()
638 finish_wait(&pag->pagb_wait, &wait); in xfs_extent_busy_flush()
646 struct xfs_perag *pag; in xfs_extent_busy_wait_all() local
650 for_each_perag(mp, agno, pag) { in xfs_extent_busy_wait_all()
652 prepare_to_wait(&pag->pagb_wait, &wait, TASK_KILLABLE); in xfs_extent_busy_wait_all()
653 if (RB_EMPTY_ROOT(&pag->pagb_tree)) in xfs_extent_busy_wait_all()
657 finish_wait(&pag->pagb_wait, &wait); in xfs_extent_busy_wait_all()