Lines Matching refs:cur
29 struct xfs_btree_cur *cur, in xfs_inobt_get_minrecs() argument
32 return M_IGEO(cur->bc_mp)->inobt_mnr[level != 0]; in xfs_inobt_get_minrecs()
37 struct xfs_btree_cur *cur) in xfs_inobt_dup_cursor() argument
39 return xfs_inobt_init_cursor(cur->bc_ag.pag, cur->bc_tp, in xfs_inobt_dup_cursor()
40 cur->bc_ag.agbp, cur->bc_btnum); in xfs_inobt_dup_cursor()
45 struct xfs_btree_cur *cur, in xfs_inobt_set_root() argument
49 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_inobt_set_root()
54 xfs_ialloc_log_agi(cur->bc_tp, agbp, XFS_AGI_ROOT | XFS_AGI_LEVEL); in xfs_inobt_set_root()
59 struct xfs_btree_cur *cur, in xfs_finobt_set_root() argument
63 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_finobt_set_root()
68 xfs_ialloc_log_agi(cur->bc_tp, agbp, in xfs_finobt_set_root()
75 struct xfs_btree_cur *cur, in xfs_inobt_mod_blockcount() argument
78 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_inobt_mod_blockcount()
81 if (!xfs_has_inobtcounts(cur->bc_mp)) in xfs_inobt_mod_blockcount()
84 if (cur->bc_btnum == XFS_BTNUM_FINO) in xfs_inobt_mod_blockcount()
86 else if (cur->bc_btnum == XFS_BTNUM_INO) in xfs_inobt_mod_blockcount()
88 xfs_ialloc_log_agi(cur->bc_tp, agbp, XFS_AGI_IBLOCKS); in xfs_inobt_mod_blockcount()
93 struct xfs_btree_cur *cur, in __xfs_inobt_alloc_block() argument
104 args.tp = cur->bc_tp; in __xfs_inobt_alloc_block()
105 args.mp = cur->bc_mp; in __xfs_inobt_alloc_block()
106 args.pag = cur->bc_ag.pag; in __xfs_inobt_alloc_block()
126 xfs_inobt_mod_blockcount(cur, 1); in __xfs_inobt_alloc_block()
132 struct xfs_btree_cur *cur, in xfs_inobt_alloc_block() argument
137 return __xfs_inobt_alloc_block(cur, start, new, stat, XFS_AG_RESV_NONE); in xfs_inobt_alloc_block()
142 struct xfs_btree_cur *cur, in xfs_finobt_alloc_block() argument
147 if (cur->bc_mp->m_finobt_nores) in xfs_finobt_alloc_block()
148 return xfs_inobt_alloc_block(cur, start, new, stat); in xfs_finobt_alloc_block()
149 return __xfs_inobt_alloc_block(cur, start, new, stat, in xfs_finobt_alloc_block()
155 struct xfs_btree_cur *cur, in __xfs_inobt_free_block() argument
161 xfs_inobt_mod_blockcount(cur, -1); in __xfs_inobt_free_block()
162 fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, xfs_buf_daddr(bp)); in __xfs_inobt_free_block()
163 return xfs_free_extent_later(cur->bc_tp, fsbno, 1, in __xfs_inobt_free_block()
169 struct xfs_btree_cur *cur, in xfs_inobt_free_block() argument
172 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_NONE); in xfs_inobt_free_block()
177 struct xfs_btree_cur *cur, in xfs_finobt_free_block() argument
180 if (cur->bc_mp->m_finobt_nores) in xfs_finobt_free_block()
181 return xfs_inobt_free_block(cur, bp); in xfs_finobt_free_block()
182 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_METADATA); in xfs_finobt_free_block()
187 struct xfs_btree_cur *cur, in xfs_inobt_get_maxrecs() argument
190 return M_IGEO(cur->bc_mp)->inobt_mxr[level != 0]; in xfs_inobt_get_maxrecs()
215 struct xfs_btree_cur *cur, in xfs_inobt_init_rec_from_cur() argument
218 rec->inobt.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); in xfs_inobt_init_rec_from_cur()
219 if (xfs_has_sparseinodes(cur->bc_mp)) { in xfs_inobt_init_rec_from_cur()
221 cpu_to_be16(cur->bc_rec.i.ir_holemask); in xfs_inobt_init_rec_from_cur()
222 rec->inobt.ir_u.sp.ir_count = cur->bc_rec.i.ir_count; in xfs_inobt_init_rec_from_cur()
223 rec->inobt.ir_u.sp.ir_freecount = cur->bc_rec.i.ir_freecount; in xfs_inobt_init_rec_from_cur()
227 cpu_to_be32(cur->bc_rec.i.ir_freecount); in xfs_inobt_init_rec_from_cur()
229 rec->inobt.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); in xfs_inobt_init_rec_from_cur()
237 struct xfs_btree_cur *cur, in xfs_inobt_init_ptr_from_cur() argument
240 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_inobt_init_ptr_from_cur()
242 ASSERT(cur->bc_ag.pag->pag_agno == be32_to_cpu(agi->agi_seqno)); in xfs_inobt_init_ptr_from_cur()
249 struct xfs_btree_cur *cur, in xfs_finobt_init_ptr_from_cur() argument
252 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_finobt_init_ptr_from_cur()
254 ASSERT(cur->bc_ag.pag->pag_agno == be32_to_cpu(agi->agi_seqno)); in xfs_finobt_init_ptr_from_cur()
260 struct xfs_btree_cur *cur, in xfs_inobt_key_diff() argument
264 cur->bc_rec.i.ir_startino; in xfs_inobt_key_diff()
269 struct xfs_btree_cur *cur, in xfs_inobt_diff_two_keys() argument
370 struct xfs_btree_cur *cur, in xfs_inobt_keys_inorder() argument
380 struct xfs_btree_cur *cur, in xfs_inobt_recs_inorder() argument
390 struct xfs_btree_cur *cur, in xfs_inobt_keys_contiguous() argument
455 struct xfs_btree_cur *cur; in xfs_inobt_init_common() local
457 cur = xfs_btree_alloc_cursor(mp, tp, btnum, in xfs_inobt_init_common()
460 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_ibt_2); in xfs_inobt_init_common()
461 cur->bc_ops = &xfs_inobt_ops; in xfs_inobt_init_common()
463 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_fibt_2); in xfs_inobt_init_common()
464 cur->bc_ops = &xfs_finobt_ops; in xfs_inobt_init_common()
468 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_inobt_init_common()
470 cur->bc_ag.pag = xfs_perag_hold(pag); in xfs_inobt_init_common()
471 return cur; in xfs_inobt_init_common()
482 struct xfs_btree_cur *cur; in xfs_inobt_init_cursor() local
485 cur = xfs_inobt_init_common(pag, tp, btnum); in xfs_inobt_init_cursor()
487 cur->bc_nlevels = be32_to_cpu(agi->agi_level); in xfs_inobt_init_cursor()
489 cur->bc_nlevels = be32_to_cpu(agi->agi_free_level); in xfs_inobt_init_cursor()
490 cur->bc_ag.agbp = agbp; in xfs_inobt_init_cursor()
491 return cur; in xfs_inobt_init_cursor()
501 struct xfs_btree_cur *cur; in xfs_inobt_stage_cursor() local
503 cur = xfs_inobt_init_common(pag, NULL, btnum); in xfs_inobt_stage_cursor()
504 xfs_btree_stage_afakeroot(cur, afake); in xfs_inobt_stage_cursor()
505 return cur; in xfs_inobt_stage_cursor()
514 struct xfs_btree_cur *cur, in xfs_inobt_commit_staged_btree() argument
519 struct xbtree_afakeroot *afake = cur->bc_ag.afake; in xfs_inobt_commit_staged_btree()
522 ASSERT(cur->bc_flags & XFS_BTREE_STAGING); in xfs_inobt_commit_staged_btree()
524 if (cur->bc_btnum == XFS_BTNUM_INO) { in xfs_inobt_commit_staged_btree()
528 if (xfs_has_inobtcounts(cur->bc_mp)) { in xfs_inobt_commit_staged_btree()
533 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_inobt_ops); in xfs_inobt_commit_staged_btree()
538 if (xfs_has_inobtcounts(cur->bc_mp)) { in xfs_inobt_commit_staged_btree()
543 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_finobt_ops); in xfs_inobt_commit_staged_btree()
733 struct xfs_btree_cur *cur; in xfs_inobt_cur() local
743 cur = xfs_inobt_init_cursor(pag, tp, *agi_bpp, which); in xfs_inobt_cur()
744 *curpp = cur; in xfs_inobt_cur()
756 struct xfs_btree_cur *cur = NULL; in xfs_inobt_count_blocks() local
759 error = xfs_inobt_cur(pag, tp, btnum, &cur, &agbp); in xfs_inobt_count_blocks()
763 error = xfs_btree_count_blocks(cur, tree_blocks); in xfs_inobt_count_blocks()
764 xfs_btree_del_cursor(cur, error); in xfs_inobt_count_blocks()