Lines Matching refs:cur
55 struct xfs_btree_cur *cur) in xfs_rmapbt_dup_cursor() argument
57 return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_rmapbt_dup_cursor()
58 cur->bc_private.a.agbp, cur->bc_private.a.agno); in xfs_rmapbt_dup_cursor()
63 struct xfs_btree_cur *cur, in xfs_rmapbt_set_root() argument
67 struct xfs_buf *agbp = cur->bc_private.a.agbp; in xfs_rmapbt_set_root()
70 int btnum = cur->bc_btnum; in xfs_rmapbt_set_root()
71 struct xfs_perag *pag = xfs_perag_get(cur->bc_mp, seqno); in xfs_rmapbt_set_root()
80 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); in xfs_rmapbt_set_root()
85 struct xfs_btree_cur *cur, in xfs_rmapbt_alloc_block() argument
90 struct xfs_buf *agbp = cur->bc_private.a.agbp; in xfs_rmapbt_alloc_block()
96 error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp, in xfs_rmapbt_alloc_block()
101 trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno, in xfs_rmapbt_alloc_block()
108 xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, in xfs_rmapbt_alloc_block()
111 xfs_trans_agbtree_delta(cur->bc_tp, 1); in xfs_rmapbt_alloc_block()
114 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); in xfs_rmapbt_alloc_block()
116 xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_private.a.agno); in xfs_rmapbt_alloc_block()
124 struct xfs_btree_cur *cur, in xfs_rmapbt_free_block() argument
127 struct xfs_buf *agbp = cur->bc_private.a.agbp; in xfs_rmapbt_free_block()
132 bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp)); in xfs_rmapbt_free_block()
133 trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_private.a.agno, in xfs_rmapbt_free_block()
136 xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS); in xfs_rmapbt_free_block()
137 error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1); in xfs_rmapbt_free_block()
141 xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1, in xfs_rmapbt_free_block()
143 xfs_trans_agbtree_delta(cur->bc_tp, -1); in xfs_rmapbt_free_block()
145 xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_private.a.agno); in xfs_rmapbt_free_block()
152 struct xfs_btree_cur *cur, in xfs_rmapbt_get_minrecs() argument
155 return cur->bc_mp->m_rmap_mnr[level != 0]; in xfs_rmapbt_get_minrecs()
160 struct xfs_btree_cur *cur, in xfs_rmapbt_get_maxrecs() argument
163 return cur->bc_mp->m_rmap_mxr[level != 0]; in xfs_rmapbt_get_maxrecs()
207 struct xfs_btree_cur *cur, in xfs_rmapbt_init_rec_from_cur() argument
210 rec->rmap.rm_startblock = cpu_to_be32(cur->bc_rec.r.rm_startblock); in xfs_rmapbt_init_rec_from_cur()
211 rec->rmap.rm_blockcount = cpu_to_be32(cur->bc_rec.r.rm_blockcount); in xfs_rmapbt_init_rec_from_cur()
212 rec->rmap.rm_owner = cpu_to_be64(cur->bc_rec.r.rm_owner); in xfs_rmapbt_init_rec_from_cur()
214 xfs_rmap_irec_offset_pack(&cur->bc_rec.r)); in xfs_rmapbt_init_rec_from_cur()
219 struct xfs_btree_cur *cur, in xfs_rmapbt_init_ptr_from_cur() argument
222 struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); in xfs_rmapbt_init_ptr_from_cur()
224 ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); in xfs_rmapbt_init_ptr_from_cur()
226 ptr->s = agf->agf_roots[cur->bc_btnum]; in xfs_rmapbt_init_ptr_from_cur()
231 struct xfs_btree_cur *cur, in xfs_rmapbt_key_diff() argument
234 struct xfs_rmap_irec *rec = &cur->bc_rec.r; in xfs_rmapbt_key_diff()
261 struct xfs_btree_cur *cur, in xfs_rmapbt_diff_two_keys() argument
375 struct xfs_btree_cur *cur, in xfs_rmapbt_keys_inorder() argument
405 struct xfs_btree_cur *cur, in xfs_rmapbt_recs_inorder() argument
465 struct xfs_btree_cur *cur; in xfs_rmapbt_init_cursor() local
467 cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_NOFS); in xfs_rmapbt_init_cursor()
468 cur->bc_tp = tp; in xfs_rmapbt_init_cursor()
469 cur->bc_mp = mp; in xfs_rmapbt_init_cursor()
471 cur->bc_btnum = XFS_BTNUM_RMAP; in xfs_rmapbt_init_cursor()
472 cur->bc_flags = XFS_BTREE_CRC_BLOCKS | XFS_BTREE_OVERLAPPING; in xfs_rmapbt_init_cursor()
473 cur->bc_blocklog = mp->m_sb.sb_blocklog; in xfs_rmapbt_init_cursor()
474 cur->bc_ops = &xfs_rmapbt_ops; in xfs_rmapbt_init_cursor()
475 cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]); in xfs_rmapbt_init_cursor()
476 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2); in xfs_rmapbt_init_cursor()
478 cur->bc_private.a.agbp = agbp; in xfs_rmapbt_init_cursor()
479 cur->bc_private.a.agno = agno; in xfs_rmapbt_init_cursor()
481 return cur; in xfs_rmapbt_init_cursor()