Lines Matching full:sa
410 struct xchk_ag *sa) in xchk_perag_read_headers() argument
414 error = xfs_ialloc_read_agi(sa->pag, sc->tp, &sa->agi_bp); in xchk_perag_read_headers()
418 error = xfs_alloc_read_agf(sa->pag, sc->tp, 0, &sa->agf_bp); in xchk_perag_read_headers()
433 struct xchk_ag *sa = &sc->sa; in xchk_perag_drain_and_lock() local
436 ASSERT(sa->pag != NULL); in xchk_perag_drain_and_lock()
437 ASSERT(sa->agi_bp == NULL); in xchk_perag_drain_and_lock()
438 ASSERT(sa->agf_bp == NULL); in xchk_perag_drain_and_lock()
444 error = xchk_perag_read_headers(sc, sa); in xchk_perag_drain_and_lock()
479 if (!xfs_perag_intent_busy(sa->pag)) in xchk_perag_drain_and_lock()
482 if (sa->agf_bp) { in xchk_perag_drain_and_lock()
483 xfs_trans_brelse(sc->tp, sa->agf_bp); in xchk_perag_drain_and_lock()
484 sa->agf_bp = NULL; in xchk_perag_drain_and_lock()
487 if (sa->agi_bp) { in xchk_perag_drain_and_lock()
488 xfs_trans_brelse(sc->tp, sa->agi_bp); in xchk_perag_drain_and_lock()
489 sa->agi_bp = NULL; in xchk_perag_drain_and_lock()
494 error = xfs_perag_intent_drain(sa->pag); in xchk_perag_drain_and_lock()
511 struct xchk_ag *sa) in xchk_ag_read_headers() argument
515 ASSERT(!sa->pag); in xchk_ag_read_headers()
516 sa->pag = xfs_perag_get(mp, agno); in xchk_ag_read_headers()
517 if (!sa->pag) in xchk_ag_read_headers()
526 struct xchk_ag *sa) in xchk_ag_btcur_free() argument
528 if (sa->refc_cur) in xchk_ag_btcur_free()
529 xfs_btree_del_cursor(sa->refc_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
530 if (sa->rmap_cur) in xchk_ag_btcur_free()
531 xfs_btree_del_cursor(sa->rmap_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
532 if (sa->fino_cur) in xchk_ag_btcur_free()
533 xfs_btree_del_cursor(sa->fino_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
534 if (sa->ino_cur) in xchk_ag_btcur_free()
535 xfs_btree_del_cursor(sa->ino_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
536 if (sa->cnt_cur) in xchk_ag_btcur_free()
537 xfs_btree_del_cursor(sa->cnt_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
538 if (sa->bno_cur) in xchk_ag_btcur_free()
539 xfs_btree_del_cursor(sa->bno_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
541 sa->refc_cur = NULL; in xchk_ag_btcur_free()
542 sa->rmap_cur = NULL; in xchk_ag_btcur_free()
543 sa->fino_cur = NULL; in xchk_ag_btcur_free()
544 sa->ino_cur = NULL; in xchk_ag_btcur_free()
545 sa->bno_cur = NULL; in xchk_ag_btcur_free()
546 sa->cnt_cur = NULL; in xchk_ag_btcur_free()
553 struct xchk_ag *sa) in xchk_ag_btcur_init() argument
557 if (sa->agf_bp && in xchk_ag_btcur_init()
558 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_BNO)) { in xchk_ag_btcur_init()
560 sa->bno_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
561 sa->pag, XFS_BTNUM_BNO); in xchk_ag_btcur_init()
564 if (sa->agf_bp && in xchk_ag_btcur_init()
565 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_CNT)) { in xchk_ag_btcur_init()
567 sa->cnt_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
568 sa->pag, XFS_BTNUM_CNT); in xchk_ag_btcur_init()
572 if (sa->agi_bp && in xchk_ag_btcur_init()
573 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_INO)) { in xchk_ag_btcur_init()
574 sa->ino_cur = xfs_inobt_init_cursor(sa->pag, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
579 if (sa->agi_bp && xfs_has_finobt(mp) && in xchk_ag_btcur_init()
580 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_FINO)) { in xchk_ag_btcur_init()
581 sa->fino_cur = xfs_inobt_init_cursor(sa->pag, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
586 if (sa->agf_bp && xfs_has_rmapbt(mp) && in xchk_ag_btcur_init()
587 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_RMAP)) { in xchk_ag_btcur_init()
588 sa->rmap_cur = xfs_rmapbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
589 sa->pag); in xchk_ag_btcur_init()
593 if (sa->agf_bp && xfs_has_reflink(mp) && in xchk_ag_btcur_init()
594 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_REFC)) { in xchk_ag_btcur_init()
595 sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp, in xchk_ag_btcur_init()
596 sa->agf_bp, sa->pag); in xchk_ag_btcur_init()
604 struct xchk_ag *sa) in xchk_ag_free() argument
606 xchk_ag_btcur_free(sa); in xchk_ag_free()
607 if (sa->agf_bp) { in xchk_ag_free()
608 xfs_trans_brelse(sc->tp, sa->agf_bp); in xchk_ag_free()
609 sa->agf_bp = NULL; in xchk_ag_free()
611 if (sa->agi_bp) { in xchk_ag_free()
612 xfs_trans_brelse(sc->tp, sa->agi_bp); in xchk_ag_free()
613 sa->agi_bp = NULL; in xchk_ag_free()
615 if (sa->pag) { in xchk_ag_free()
616 xfs_perag_put(sa->pag); in xchk_ag_free()
617 sa->pag = NULL; in xchk_ag_free()
632 struct xchk_ag *sa) in xchk_ag_init() argument
636 error = xchk_ag_read_headers(sc, agno, sa); in xchk_ag_init()
640 xchk_ag_btcur_init(sc, sa); in xchk_ag_init()
712 return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa); in xchk_setup_ag_btree()
1251 struct xfs_perag *pag = sc->sa.pag; in xchk_inode_is_allocated()
1263 if (sc->sa.agi_bp == NULL) { in xchk_inode_is_allocated()
1264 ASSERT(sc->sa.agi_bp != NULL); in xchk_inode_is_allocated()