Lines Matching refs:cur
26 struct xfs_btree_cur *cur) in xfs_allocbt_dup_cursor() argument
28 return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_allocbt_dup_cursor()
29 cur->bc_ag.agbp, cur->bc_ag.agno, in xfs_allocbt_dup_cursor()
30 cur->bc_btnum); in xfs_allocbt_dup_cursor()
35 struct xfs_btree_cur *cur, in xfs_allocbt_set_root() argument
39 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_allocbt_set_root()
41 int btnum = cur->bc_btnum; in xfs_allocbt_set_root()
50 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); in xfs_allocbt_set_root()
55 struct xfs_btree_cur *cur, in xfs_allocbt_alloc_block() argument
64 error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp, in xfs_allocbt_alloc_block()
74 xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1, false); in xfs_allocbt_alloc_block()
76 xfs_trans_agbtree_delta(cur->bc_tp, 1); in xfs_allocbt_alloc_block()
85 struct xfs_btree_cur *cur, in xfs_allocbt_free_block() argument
88 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_allocbt_free_block()
93 bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp)); in xfs_allocbt_free_block()
94 error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1); in xfs_allocbt_free_block()
98 xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1, in xfs_allocbt_free_block()
100 xfs_trans_agbtree_delta(cur->bc_tp, -1); in xfs_allocbt_free_block()
109 struct xfs_btree_cur *cur, in xfs_allocbt_update_lastrec() argument
115 struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; in xfs_allocbt_update_lastrec()
120 ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); in xfs_allocbt_update_lastrec()
147 rrp = XFS_ALLOC_REC_ADDR(cur->bc_mp, block, numrecs); in xfs_allocbt_update_lastrec()
160 pag = cur->bc_ag.agbp->b_pag; in xfs_allocbt_update_lastrec()
162 xfs_alloc_log_agf(cur->bc_tp, cur->bc_ag.agbp, XFS_AGF_LONGEST); in xfs_allocbt_update_lastrec()
167 struct xfs_btree_cur *cur, in xfs_allocbt_get_minrecs() argument
170 return cur->bc_mp->m_alloc_mnr[level != 0]; in xfs_allocbt_get_minrecs()
175 struct xfs_btree_cur *cur, in xfs_allocbt_get_maxrecs() argument
178 return cur->bc_mp->m_alloc_mxr[level != 0]; in xfs_allocbt_get_maxrecs()
214 struct xfs_btree_cur *cur, in xfs_allocbt_init_rec_from_cur() argument
217 rec->alloc.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); in xfs_allocbt_init_rec_from_cur()
218 rec->alloc.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); in xfs_allocbt_init_rec_from_cur()
223 struct xfs_btree_cur *cur, in xfs_allocbt_init_ptr_from_cur() argument
226 struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; in xfs_allocbt_init_ptr_from_cur()
228 ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno)); in xfs_allocbt_init_ptr_from_cur()
230 ptr->s = agf->agf_roots[cur->bc_btnum]; in xfs_allocbt_init_ptr_from_cur()
235 struct xfs_btree_cur *cur, in xfs_bnobt_key_diff() argument
238 xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; in xfs_bnobt_key_diff()
246 struct xfs_btree_cur *cur, in xfs_cntbt_key_diff() argument
249 xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; in xfs_cntbt_key_diff()
262 struct xfs_btree_cur *cur, in xfs_bnobt_diff_two_keys() argument
272 struct xfs_btree_cur *cur, in xfs_cntbt_diff_two_keys() argument
382 struct xfs_btree_cur *cur, in xfs_bnobt_keys_inorder() argument
392 struct xfs_btree_cur *cur, in xfs_bnobt_recs_inorder() argument
403 struct xfs_btree_cur *cur, in xfs_cntbt_keys_inorder() argument
416 struct xfs_btree_cur *cur, in xfs_cntbt_recs_inorder() argument
479 struct xfs_btree_cur *cur; in xfs_allocbt_init_common() local
483 cur = kmem_cache_zalloc(xfs_btree_cur_zone, GFP_NOFS | __GFP_NOFAIL); in xfs_allocbt_init_common()
485 cur->bc_tp = tp; in xfs_allocbt_init_common()
486 cur->bc_mp = mp; in xfs_allocbt_init_common()
487 cur->bc_btnum = btnum; in xfs_allocbt_init_common()
488 cur->bc_blocklog = mp->m_sb.sb_blocklog; in xfs_allocbt_init_common()
491 cur->bc_ops = &xfs_cntbt_ops; in xfs_allocbt_init_common()
492 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtc_2); in xfs_allocbt_init_common()
493 cur->bc_flags = XFS_BTREE_LASTREC_UPDATE; in xfs_allocbt_init_common()
495 cur->bc_ops = &xfs_bnobt_ops; in xfs_allocbt_init_common()
496 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtb_2); in xfs_allocbt_init_common()
499 cur->bc_ag.agno = agno; in xfs_allocbt_init_common()
500 cur->bc_ag.abt.active = false; in xfs_allocbt_init_common()
503 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_allocbt_init_common()
505 return cur; in xfs_allocbt_init_common()
520 struct xfs_btree_cur *cur; in xfs_allocbt_init_cursor() local
522 cur = xfs_allocbt_init_common(mp, tp, agno, btnum); in xfs_allocbt_init_cursor()
524 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]); in xfs_allocbt_init_cursor()
526 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]); in xfs_allocbt_init_cursor()
528 cur->bc_ag.agbp = agbp; in xfs_allocbt_init_cursor()
530 return cur; in xfs_allocbt_init_cursor()
541 struct xfs_btree_cur *cur; in xfs_allocbt_stage_cursor() local
543 cur = xfs_allocbt_init_common(mp, NULL, agno, btnum); in xfs_allocbt_stage_cursor()
544 xfs_btree_stage_afakeroot(cur, afake); in xfs_allocbt_stage_cursor()
545 return cur; in xfs_allocbt_stage_cursor()
554 struct xfs_btree_cur *cur, in xfs_allocbt_commit_staged_btree() argument
559 struct xbtree_afakeroot *afake = cur->bc_ag.afake; in xfs_allocbt_commit_staged_btree()
561 ASSERT(cur->bc_flags & XFS_BTREE_STAGING); in xfs_allocbt_commit_staged_btree()
563 agf->agf_roots[cur->bc_btnum] = cpu_to_be32(afake->af_root); in xfs_allocbt_commit_staged_btree()
564 agf->agf_levels[cur->bc_btnum] = cpu_to_be32(afake->af_levels); in xfs_allocbt_commit_staged_btree()
567 if (cur->bc_btnum == XFS_BTNUM_BNO) { in xfs_allocbt_commit_staged_btree()
568 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_bnobt_ops); in xfs_allocbt_commit_staged_btree()
570 cur->bc_flags |= XFS_BTREE_LASTREC_UPDATE; in xfs_allocbt_commit_staged_btree()
571 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_cntbt_ops); in xfs_allocbt_commit_staged_btree()