Lines Matching refs:cur

27 	struct xfs_btree_cur	*cur)  in xfs_allocbt_dup_cursor()  argument
29 return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_allocbt_dup_cursor()
30 cur->bc_ag.agbp, cur->bc_ag.pag, 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()
47 cur->bc_ag.pag->pagf_levels[btnum] += inc; in xfs_allocbt_set_root()
49 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); in xfs_allocbt_set_root()
54 struct xfs_btree_cur *cur, in xfs_allocbt_alloc_block() argument
63 error = xfs_alloc_get_freelist(cur->bc_ag.pag, cur->bc_tp, in xfs_allocbt_alloc_block()
64 cur->bc_ag.agbp, &bno, 1); in xfs_allocbt_alloc_block()
73 atomic64_inc(&cur->bc_mp->m_allocbt_blks); in xfs_allocbt_alloc_block()
74 xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.pag, bno, 1, false); in xfs_allocbt_alloc_block()
84 struct xfs_btree_cur *cur, in xfs_allocbt_free_block() argument
87 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_allocbt_free_block()
91 bno = xfs_daddr_to_agbno(cur->bc_mp, xfs_buf_daddr(bp)); in xfs_allocbt_free_block()
92 error = xfs_alloc_put_freelist(cur->bc_ag.pag, cur->bc_tp, agbp, NULL, in xfs_allocbt_free_block()
97 atomic64_dec(&cur->bc_mp->m_allocbt_blks); in xfs_allocbt_free_block()
98 xfs_extent_busy_insert(cur->bc_tp, agbp->b_pag, bno, 1, in xfs_allocbt_free_block()
108 struct xfs_btree_cur *cur, in xfs_allocbt_update_lastrec() argument
114 struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; in xfs_allocbt_update_lastrec()
119 ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); in xfs_allocbt_update_lastrec()
146 rrp = XFS_ALLOC_REC_ADDR(cur->bc_mp, block, numrecs); in xfs_allocbt_update_lastrec()
159 pag = cur->bc_ag.agbp->b_pag; in xfs_allocbt_update_lastrec()
161 xfs_alloc_log_agf(cur->bc_tp, cur->bc_ag.agbp, XFS_AGF_LONGEST); in xfs_allocbt_update_lastrec()
166 struct xfs_btree_cur *cur, in xfs_allocbt_get_minrecs() argument
169 return cur->bc_mp->m_alloc_mnr[level != 0]; in xfs_allocbt_get_minrecs()
174 struct xfs_btree_cur *cur, in xfs_allocbt_get_maxrecs() argument
177 return cur->bc_mp->m_alloc_mxr[level != 0]; in xfs_allocbt_get_maxrecs()
213 struct xfs_btree_cur *cur, in xfs_allocbt_init_rec_from_cur() argument
216 rec->alloc.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); in xfs_allocbt_init_rec_from_cur()
217 rec->alloc.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); in xfs_allocbt_init_rec_from_cur()
222 struct xfs_btree_cur *cur, in xfs_allocbt_init_ptr_from_cur() argument
225 struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; in xfs_allocbt_init_ptr_from_cur()
227 ASSERT(cur->bc_ag.pag->pag_agno == be32_to_cpu(agf->agf_seqno)); in xfs_allocbt_init_ptr_from_cur()
229 ptr->s = agf->agf_roots[cur->bc_btnum]; in xfs_allocbt_init_ptr_from_cur()
234 struct xfs_btree_cur *cur, in xfs_bnobt_key_diff() argument
237 struct xfs_alloc_rec_incore *rec = &cur->bc_rec.a; in xfs_bnobt_key_diff()
245 struct xfs_btree_cur *cur, in xfs_cntbt_key_diff() argument
248 struct xfs_alloc_rec_incore *rec = &cur->bc_rec.a; in xfs_cntbt_key_diff()
261 struct xfs_btree_cur *cur, in xfs_bnobt_diff_two_keys() argument
274 struct xfs_btree_cur *cur, in xfs_cntbt_diff_two_keys() argument
388 struct xfs_btree_cur *cur, in xfs_bnobt_keys_inorder() argument
398 struct xfs_btree_cur *cur, in xfs_bnobt_recs_inorder() argument
409 struct xfs_btree_cur *cur, in xfs_cntbt_keys_inorder() argument
422 struct xfs_btree_cur *cur, in xfs_cntbt_recs_inorder() argument
435 struct xfs_btree_cur *cur, in xfs_allocbt_keys_contiguous() argument
500 struct xfs_btree_cur *cur; in xfs_allocbt_init_common() local
504 cur = xfs_btree_alloc_cursor(mp, tp, btnum, mp->m_alloc_maxlevels, in xfs_allocbt_init_common()
506 cur->bc_ag.abt.active = false; in xfs_allocbt_init_common()
509 cur->bc_ops = &xfs_cntbt_ops; in xfs_allocbt_init_common()
510 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtc_2); in xfs_allocbt_init_common()
511 cur->bc_flags = XFS_BTREE_LASTREC_UPDATE; in xfs_allocbt_init_common()
513 cur->bc_ops = &xfs_bnobt_ops; in xfs_allocbt_init_common()
514 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtb_2); in xfs_allocbt_init_common()
517 cur->bc_ag.pag = xfs_perag_hold(pag); in xfs_allocbt_init_common()
520 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_allocbt_init_common()
522 return cur; in xfs_allocbt_init_common()
537 struct xfs_btree_cur *cur; in xfs_allocbt_init_cursor() local
539 cur = xfs_allocbt_init_common(mp, tp, pag, btnum); in xfs_allocbt_init_cursor()
541 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]); in xfs_allocbt_init_cursor()
543 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]); in xfs_allocbt_init_cursor()
545 cur->bc_ag.agbp = agbp; in xfs_allocbt_init_cursor()
547 return cur; in xfs_allocbt_init_cursor()
558 struct xfs_btree_cur *cur; in xfs_allocbt_stage_cursor() local
560 cur = xfs_allocbt_init_common(mp, NULL, pag, btnum); in xfs_allocbt_stage_cursor()
561 xfs_btree_stage_afakeroot(cur, afake); in xfs_allocbt_stage_cursor()
562 return cur; in xfs_allocbt_stage_cursor()
571 struct xfs_btree_cur *cur, in xfs_allocbt_commit_staged_btree() argument
576 struct xbtree_afakeroot *afake = cur->bc_ag.afake; in xfs_allocbt_commit_staged_btree()
578 ASSERT(cur->bc_flags & XFS_BTREE_STAGING); in xfs_allocbt_commit_staged_btree()
580 agf->agf_roots[cur->bc_btnum] = cpu_to_be32(afake->af_root); in xfs_allocbt_commit_staged_btree()
581 agf->agf_levels[cur->bc_btnum] = cpu_to_be32(afake->af_levels); in xfs_allocbt_commit_staged_btree()
584 if (cur->bc_btnum == XFS_BTNUM_BNO) { in xfs_allocbt_commit_staged_btree()
585 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_bnobt_ops); in xfs_allocbt_commit_staged_btree()
587 cur->bc_flags |= XFS_BTREE_LASTREC_UPDATE; in xfs_allocbt_commit_staged_btree()
588 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_cntbt_ops); in xfs_allocbt_commit_staged_btree()