Lines Matching refs:sa
407 struct xchk_ag *sa) in xchk_ag_read_headers() argument
412 ASSERT(!sa->pag); in xchk_ag_read_headers()
413 sa->pag = xfs_perag_get(mp, agno); in xchk_ag_read_headers()
414 if (!sa->pag) in xchk_ag_read_headers()
417 error = xfs_ialloc_read_agi(mp, sc->tp, agno, &sa->agi_bp); in xchk_ag_read_headers()
421 error = xfs_alloc_read_agf(mp, sc->tp, agno, 0, &sa->agf_bp); in xchk_ag_read_headers()
425 error = xfs_alloc_read_agfl(mp, sc->tp, agno, &sa->agfl_bp); in xchk_ag_read_headers()
435 struct xchk_ag *sa) in xchk_ag_btcur_free() argument
437 if (sa->refc_cur) in xchk_ag_btcur_free()
438 xfs_btree_del_cursor(sa->refc_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
439 if (sa->rmap_cur) in xchk_ag_btcur_free()
440 xfs_btree_del_cursor(sa->rmap_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
441 if (sa->fino_cur) in xchk_ag_btcur_free()
442 xfs_btree_del_cursor(sa->fino_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
443 if (sa->ino_cur) in xchk_ag_btcur_free()
444 xfs_btree_del_cursor(sa->ino_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
445 if (sa->cnt_cur) in xchk_ag_btcur_free()
446 xfs_btree_del_cursor(sa->cnt_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
447 if (sa->bno_cur) in xchk_ag_btcur_free()
448 xfs_btree_del_cursor(sa->bno_cur, XFS_BTREE_ERROR); in xchk_ag_btcur_free()
450 sa->refc_cur = NULL; in xchk_ag_btcur_free()
451 sa->rmap_cur = NULL; in xchk_ag_btcur_free()
452 sa->fino_cur = NULL; in xchk_ag_btcur_free()
453 sa->ino_cur = NULL; in xchk_ag_btcur_free()
454 sa->bno_cur = NULL; in xchk_ag_btcur_free()
455 sa->cnt_cur = NULL; in xchk_ag_btcur_free()
462 struct xchk_ag *sa) in xchk_ag_btcur_init() argument
466 if (sa->agf_bp && in xchk_ag_btcur_init()
467 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_BNO)) { in xchk_ag_btcur_init()
469 sa->bno_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
470 sa->pag, XFS_BTNUM_BNO); in xchk_ag_btcur_init()
473 if (sa->agf_bp && in xchk_ag_btcur_init()
474 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_CNT)) { in xchk_ag_btcur_init()
476 sa->cnt_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
477 sa->pag, XFS_BTNUM_CNT); in xchk_ag_btcur_init()
481 if (sa->agi_bp && in xchk_ag_btcur_init()
482 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_INO)) { in xchk_ag_btcur_init()
483 sa->ino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
484 sa->pag, XFS_BTNUM_INO); in xchk_ag_btcur_init()
488 if (sa->agi_bp && xfs_has_finobt(mp) && in xchk_ag_btcur_init()
489 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_FINO)) { in xchk_ag_btcur_init()
490 sa->fino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
491 sa->pag, XFS_BTNUM_FINO); in xchk_ag_btcur_init()
495 if (sa->agf_bp && xfs_has_rmapbt(mp) && in xchk_ag_btcur_init()
496 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_RMAP)) { in xchk_ag_btcur_init()
497 sa->rmap_cur = xfs_rmapbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
498 sa->pag); in xchk_ag_btcur_init()
502 if (sa->agf_bp && xfs_has_reflink(mp) && in xchk_ag_btcur_init()
503 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_REFC)) { in xchk_ag_btcur_init()
504 sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp, in xchk_ag_btcur_init()
505 sa->agf_bp, sa->pag); in xchk_ag_btcur_init()
513 struct xchk_ag *sa) in xchk_ag_free() argument
515 xchk_ag_btcur_free(sa); in xchk_ag_free()
516 if (sa->agfl_bp) { in xchk_ag_free()
517 xfs_trans_brelse(sc->tp, sa->agfl_bp); in xchk_ag_free()
518 sa->agfl_bp = NULL; in xchk_ag_free()
520 if (sa->agf_bp) { in xchk_ag_free()
521 xfs_trans_brelse(sc->tp, sa->agf_bp); in xchk_ag_free()
522 sa->agf_bp = NULL; in xchk_ag_free()
524 if (sa->agi_bp) { in xchk_ag_free()
525 xfs_trans_brelse(sc->tp, sa->agi_bp); in xchk_ag_free()
526 sa->agi_bp = NULL; in xchk_ag_free()
528 if (sa->pag) { in xchk_ag_free()
529 xfs_perag_put(sa->pag); in xchk_ag_free()
530 sa->pag = NULL; in xchk_ag_free()
545 struct xchk_ag *sa) in xchk_ag_init() argument
549 error = xchk_ag_read_headers(sc, agno, sa); in xchk_ag_init()
553 xchk_ag_btcur_init(sc, sa); in xchk_ag_init()
617 return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa); in xchk_setup_ag_btree()