Lines Matching refs:agf
773 struct xfs_agf *agf = agbp->b_addr; in xfs_alloc_update_counters() local
776 be32_add_cpu(&agf->agf_freeblks, len); in xfs_alloc_update_counters()
778 if (unlikely(be32_to_cpu(agf->agf_freeblks) > in xfs_alloc_update_counters()
779 be32_to_cpu(agf->agf_length))) { in xfs_alloc_update_counters()
978 struct xfs_agf __maybe_unused *agf = args->agbp->b_addr; in xfs_alloc_cur_finish() local
984 ASSERT(acur->rec_bno + acur->rec_len <= be32_to_cpu(agf->agf_length)); in xfs_alloc_cur_finish()
1082 struct xfs_agf *agf = args->agbp->b_addr; in xfs_alloc_ag_vextent_small() local
1111 be32_to_cpu(agf->agf_flcount) <= args->minleft) in xfs_alloc_ag_vextent_small()
1136 if (XFS_IS_CORRUPT(args->mp, fbno >= be32_to_cpu(agf->agf_length))) { in xfs_alloc_ag_vextent_small()
1185 struct xfs_agf __maybe_unused *agf = args->agbp->b_addr; in xfs_alloc_ag_vextent_exact() local
1264 ASSERT(args->agbno + args->len <= be32_to_cpu(agf->agf_length)); in xfs_alloc_ag_vextent_exact()
1657 struct xfs_agf *agf = args->agbp->b_addr; in xfs_alloc_ag_vextent_size() local
1867 be32_to_cpu(agf->agf_length))) { in xfs_alloc_ag_vextent_size()
2389 struct xfs_agf *agf) in xfs_agfl_needs_reset() argument
2391 uint32_t f = be32_to_cpu(agf->agf_flfirst); in xfs_agfl_needs_reset()
2392 uint32_t l = be32_to_cpu(agf->agf_fllast); in xfs_agfl_needs_reset()
2393 uint32_t c = be32_to_cpu(agf->agf_flcount); in xfs_agfl_needs_reset()
2438 struct xfs_agf *agf = agbp->b_addr; in xfs_agfl_reset() local
2441 trace_xfs_agfl_reset(mp, agf, 0, _RET_IP_); in xfs_agfl_reset()
2448 agf->agf_flfirst = 0; in xfs_agfl_reset()
2449 agf->agf_fllast = cpu_to_be32(xfs_agfl_size(mp) - 1); in xfs_agfl_reset()
2450 agf->agf_flcount = 0; in xfs_agfl_reset()
2806 struct xfs_agf *agf = agbp->b_addr; in xfs_alloc_get_freelist() local
2817 if (!agf->agf_flcount) { in xfs_alloc_get_freelist()
2833 bno = be32_to_cpu(agfl_bno[be32_to_cpu(agf->agf_flfirst)]); in xfs_alloc_get_freelist()
2837 be32_add_cpu(&agf->agf_flfirst, 1); in xfs_alloc_get_freelist()
2839 if (be32_to_cpu(agf->agf_flfirst) == xfs_agfl_size(mp)) in xfs_alloc_get_freelist()
2840 agf->agf_flfirst = 0; in xfs_alloc_get_freelist()
2843 be32_add_cpu(&agf->agf_flcount, -1); in xfs_alloc_get_freelist()
2848 be32_add_cpu(&agf->agf_btreeblks, 1); in xfs_alloc_get_freelist()
2914 struct xfs_agf *agf = agbp->b_addr; in xfs_alloc_put_freelist() local
2927 be32_add_cpu(&agf->agf_fllast, 1); in xfs_alloc_put_freelist()
2928 if (be32_to_cpu(agf->agf_fllast) == xfs_agfl_size(mp)) in xfs_alloc_put_freelist()
2929 agf->agf_fllast = 0; in xfs_alloc_put_freelist()
2932 be32_add_cpu(&agf->agf_flcount, 1); in xfs_alloc_put_freelist()
2937 be32_add_cpu(&agf->agf_btreeblks, -1); in xfs_alloc_put_freelist()
2944 ASSERT(be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp)); in xfs_alloc_put_freelist()
2947 blockp = &agfl_bno[be32_to_cpu(agf->agf_fllast)]; in xfs_alloc_put_freelist()
3018 struct xfs_agf *agf = bp->b_addr; in xfs_agf_verify() local
3020 uint32_t agf_seqno = be32_to_cpu(agf->agf_seqno); in xfs_agf_verify()
3021 uint32_t agf_length = be32_to_cpu(agf->agf_length); in xfs_agf_verify()
3024 if (!uuid_equal(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid)) in xfs_agf_verify()
3026 if (!xfs_log_check_lsn(mp, be64_to_cpu(agf->agf_lsn))) in xfs_agf_verify()
3030 if (!xfs_verify_magic(bp, agf->agf_magicnum)) in xfs_agf_verify()
3033 if (!XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum))) in xfs_agf_verify()
3044 if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp)) in xfs_agf_verify()
3046 if (be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) in xfs_agf_verify()
3048 if (be32_to_cpu(agf->agf_flcount) > xfs_agfl_size(mp)) in xfs_agf_verify()
3051 if (be32_to_cpu(agf->agf_freeblks) < be32_to_cpu(agf->agf_longest) || in xfs_agf_verify()
3052 be32_to_cpu(agf->agf_freeblks) > agf_length) in xfs_agf_verify()
3055 if (be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) < 1 || in xfs_agf_verify()
3056 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]) < 1 || in xfs_agf_verify()
3057 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) > in xfs_agf_verify()
3059 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]) > in xfs_agf_verify()
3064 be32_to_cpu(agf->agf_btreeblks) > agf_length) in xfs_agf_verify()
3068 if (be32_to_cpu(agf->agf_rmap_blocks) > agf_length) in xfs_agf_verify()
3071 if (be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) < 1 || in xfs_agf_verify()
3072 be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) > in xfs_agf_verify()
3078 if (be32_to_cpu(agf->agf_refcount_blocks) > agf_length) in xfs_agf_verify()
3081 if (be32_to_cpu(agf->agf_refcount_level) < 1 || in xfs_agf_verify()
3082 be32_to_cpu(agf->agf_refcount_level) > mp->m_refc_maxlevels) in xfs_agf_verify()
3112 struct xfs_agf *agf = bp->b_addr; in xfs_agf_write_verify() local
3125 agf->agf_lsn = cpu_to_be64(bip->bli_item.li_lsn); in xfs_agf_write_verify()
3176 struct xfs_agf *agf; in xfs_alloc_read_agf() local
3191 agf = agfbp->b_addr; in xfs_alloc_read_agf()
3193 pag->pagf_freeblks = be32_to_cpu(agf->agf_freeblks); in xfs_alloc_read_agf()
3194 pag->pagf_btreeblks = be32_to_cpu(agf->agf_btreeblks); in xfs_alloc_read_agf()
3195 pag->pagf_flcount = be32_to_cpu(agf->agf_flcount); in xfs_alloc_read_agf()
3196 pag->pagf_longest = be32_to_cpu(agf->agf_longest); in xfs_alloc_read_agf()
3198 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]); in xfs_alloc_read_agf()
3200 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]); in xfs_alloc_read_agf()
3202 be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAPi]); in xfs_alloc_read_agf()
3203 pag->pagf_refcount_level = be32_to_cpu(agf->agf_refcount_level); in xfs_alloc_read_agf()
3204 if (xfs_agfl_needs_reset(pag->pag_mount, agf)) in xfs_alloc_read_agf()
3218 allocbt_blks -= be32_to_cpu(agf->agf_rmap_blocks) - 1; in xfs_alloc_read_agf()
3227 ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks)); in xfs_alloc_read_agf()
3228 ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks)); in xfs_alloc_read_agf()
3229 ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount)); in xfs_alloc_read_agf()
3230 ASSERT(pag->pagf_longest == be32_to_cpu(agf->agf_longest)); in xfs_alloc_read_agf()
3232 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi])); in xfs_alloc_read_agf()
3234 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi])); in xfs_alloc_read_agf()
3771 struct xfs_agf *agf; in __xfs_free_extent() local
3785 agf = agbp->b_addr; in __xfs_free_extent()
3793 if (XFS_IS_CORRUPT(mp, agbno + len > be32_to_cpu(agf->agf_length))) { in __xfs_free_extent()
3899 struct xfs_agf *agf, in xfs_agfl_walk() argument
3909 i = be32_to_cpu(agf->agf_flfirst); in xfs_agfl_walk()
3912 if (agf->agf_flcount == cpu_to_be32(0)) in xfs_agfl_walk()
3920 if (i == be32_to_cpu(agf->agf_fllast)) in xfs_agfl_walk()