Lines Matching refs:cur
52 struct xfs_btree_cur *cur) in xfs_rmapbt_dup_cursor() argument
54 return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_rmapbt_dup_cursor()
55 cur->bc_ag.agbp, cur->bc_ag.agno); in xfs_rmapbt_dup_cursor()
60 struct xfs_btree_cur *cur, in xfs_rmapbt_set_root() argument
64 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_rmapbt_set_root()
66 int btnum = cur->bc_btnum; in xfs_rmapbt_set_root()
75 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); in xfs_rmapbt_set_root()
80 struct xfs_btree_cur *cur, in xfs_rmapbt_alloc_block() argument
85 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_rmapbt_alloc_block()
91 error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp, in xfs_rmapbt_alloc_block()
96 trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_ag.agno, in xfs_rmapbt_alloc_block()
103 xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1, in xfs_rmapbt_alloc_block()
106 xfs_trans_agbtree_delta(cur->bc_tp, 1); in xfs_rmapbt_alloc_block()
109 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); in xfs_rmapbt_alloc_block()
111 xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_ag.agno); in xfs_rmapbt_alloc_block()
119 struct xfs_btree_cur *cur, in xfs_rmapbt_free_block() argument
122 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_rmapbt_free_block()
128 bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp)); in xfs_rmapbt_free_block()
129 trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_ag.agno, in xfs_rmapbt_free_block()
132 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); in xfs_rmapbt_free_block()
133 error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1); in xfs_rmapbt_free_block()
137 xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1, in xfs_rmapbt_free_block()
139 xfs_trans_agbtree_delta(cur->bc_tp, -1); in xfs_rmapbt_free_block()
141 pag = cur->bc_ag.agbp->b_pag; in xfs_rmapbt_free_block()
148 struct xfs_btree_cur *cur, in xfs_rmapbt_get_minrecs() argument
151 return cur->bc_mp->m_rmap_mnr[level != 0]; in xfs_rmapbt_get_minrecs()
156 struct xfs_btree_cur *cur, in xfs_rmapbt_get_maxrecs() argument
159 return cur->bc_mp->m_rmap_mxr[level != 0]; in xfs_rmapbt_get_maxrecs()
203 struct xfs_btree_cur *cur, in xfs_rmapbt_init_rec_from_cur() argument
206 rec->rmap.rm_startblock = cpu_to_be32(cur->bc_rec.r.rm_startblock); in xfs_rmapbt_init_rec_from_cur()
207 rec->rmap.rm_blockcount = cpu_to_be32(cur->bc_rec.r.rm_blockcount); in xfs_rmapbt_init_rec_from_cur()
208 rec->rmap.rm_owner = cpu_to_be64(cur->bc_rec.r.rm_owner); in xfs_rmapbt_init_rec_from_cur()
210 xfs_rmap_irec_offset_pack(&cur->bc_rec.r)); in xfs_rmapbt_init_rec_from_cur()
215 struct xfs_btree_cur *cur, in xfs_rmapbt_init_ptr_from_cur() argument
218 struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; in xfs_rmapbt_init_ptr_from_cur()
220 ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno)); in xfs_rmapbt_init_ptr_from_cur()
222 ptr->s = agf->agf_roots[cur->bc_btnum]; in xfs_rmapbt_init_ptr_from_cur()
227 struct xfs_btree_cur *cur, in xfs_rmapbt_key_diff() argument
230 struct xfs_rmap_irec *rec = &cur->bc_rec.r; in xfs_rmapbt_key_diff()
257 struct xfs_btree_cur *cur, in xfs_rmapbt_diff_two_keys() argument
372 struct xfs_btree_cur *cur, in xfs_rmapbt_keys_inorder() argument
402 struct xfs_btree_cur *cur, in xfs_rmapbt_recs_inorder() argument
457 struct xfs_btree_cur *cur; in xfs_rmapbt_init_common() local
459 cur = kmem_cache_zalloc(xfs_btree_cur_zone, GFP_NOFS | __GFP_NOFAIL); in xfs_rmapbt_init_common()
460 cur->bc_tp = tp; in xfs_rmapbt_init_common()
461 cur->bc_mp = mp; in xfs_rmapbt_init_common()
463 cur->bc_btnum = XFS_BTNUM_RMAP; in xfs_rmapbt_init_common()
464 cur->bc_flags = XFS_BTREE_CRC_BLOCKS | XFS_BTREE_OVERLAPPING; in xfs_rmapbt_init_common()
465 cur->bc_blocklog = mp->m_sb.sb_blocklog; in xfs_rmapbt_init_common()
466 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2); in xfs_rmapbt_init_common()
467 cur->bc_ag.agno = agno; in xfs_rmapbt_init_common()
468 cur->bc_ops = &xfs_rmapbt_ops; in xfs_rmapbt_init_common()
470 return cur; in xfs_rmapbt_init_common()
482 struct xfs_btree_cur *cur; in xfs_rmapbt_init_cursor() local
484 cur = xfs_rmapbt_init_common(mp, tp, agno); in xfs_rmapbt_init_cursor()
485 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]); in xfs_rmapbt_init_cursor()
486 cur->bc_ag.agbp = agbp; in xfs_rmapbt_init_cursor()
487 return cur; in xfs_rmapbt_init_cursor()
497 struct xfs_btree_cur *cur; in xfs_rmapbt_stage_cursor() local
499 cur = xfs_rmapbt_init_common(mp, NULL, agno); in xfs_rmapbt_stage_cursor()
500 xfs_btree_stage_afakeroot(cur, afake); in xfs_rmapbt_stage_cursor()
501 return cur; in xfs_rmapbt_stage_cursor()
510 struct xfs_btree_cur *cur, in xfs_rmapbt_commit_staged_btree() argument
515 struct xbtree_afakeroot *afake = cur->bc_ag.afake; in xfs_rmapbt_commit_staged_btree()
517 ASSERT(cur->bc_flags & XFS_BTREE_STAGING); in xfs_rmapbt_commit_staged_btree()
519 agf->agf_roots[cur->bc_btnum] = cpu_to_be32(afake->af_root); in xfs_rmapbt_commit_staged_btree()
520 agf->agf_levels[cur->bc_btnum] = cpu_to_be32(afake->af_levels); in xfs_rmapbt_commit_staged_btree()
524 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_rmapbt_ops); in xfs_rmapbt_commit_staged_btree()