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_mp, cur->bc_tp, in xfs_inobt_dup_cursor()
40 cur->bc_ag.agbp, cur->bc_ag.pag, 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()
107 args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_ag.pag->pag_agno, sbno); 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
159 xfs_inobt_mod_blockcount(cur, -1); in __xfs_inobt_free_block()
160 return xfs_free_extent(cur->bc_tp, in __xfs_inobt_free_block()
161 XFS_DADDR_TO_FSB(cur->bc_mp, xfs_buf_daddr(bp)), 1, in __xfs_inobt_free_block()
167 struct xfs_btree_cur *cur, in xfs_inobt_free_block() argument
170 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_NONE); in xfs_inobt_free_block()
175 struct xfs_btree_cur *cur, in xfs_finobt_free_block() argument
178 if (cur->bc_mp->m_finobt_nores) in xfs_finobt_free_block()
179 return xfs_inobt_free_block(cur, bp); in xfs_finobt_free_block()
180 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_METADATA); in xfs_finobt_free_block()
185 struct xfs_btree_cur *cur, in xfs_inobt_get_maxrecs() argument
188 return M_IGEO(cur->bc_mp)->inobt_mxr[level != 0]; in xfs_inobt_get_maxrecs()
213 struct xfs_btree_cur *cur, in xfs_inobt_init_rec_from_cur() argument
216 rec->inobt.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); in xfs_inobt_init_rec_from_cur()
217 if (xfs_has_sparseinodes(cur->bc_mp)) { in xfs_inobt_init_rec_from_cur()
219 cpu_to_be16(cur->bc_rec.i.ir_holemask); in xfs_inobt_init_rec_from_cur()
220 rec->inobt.ir_u.sp.ir_count = cur->bc_rec.i.ir_count; in xfs_inobt_init_rec_from_cur()
221 rec->inobt.ir_u.sp.ir_freecount = cur->bc_rec.i.ir_freecount; in xfs_inobt_init_rec_from_cur()
225 cpu_to_be32(cur->bc_rec.i.ir_freecount); in xfs_inobt_init_rec_from_cur()
227 rec->inobt.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); in xfs_inobt_init_rec_from_cur()
235 struct xfs_btree_cur *cur, in xfs_inobt_init_ptr_from_cur() argument
238 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_inobt_init_ptr_from_cur()
240 ASSERT(cur->bc_ag.pag->pag_agno == be32_to_cpu(agi->agi_seqno)); in xfs_inobt_init_ptr_from_cur()
247 struct xfs_btree_cur *cur, in xfs_finobt_init_ptr_from_cur() argument
250 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_finobt_init_ptr_from_cur()
252 ASSERT(cur->bc_ag.pag->pag_agno == be32_to_cpu(agi->agi_seqno)); in xfs_finobt_init_ptr_from_cur()
258 struct xfs_btree_cur *cur, in xfs_inobt_key_diff() argument
262 cur->bc_rec.i.ir_startino; in xfs_inobt_key_diff()
267 struct xfs_btree_cur *cur, in xfs_inobt_diff_two_keys() argument
365 struct xfs_btree_cur *cur, in xfs_inobt_keys_inorder() argument
375 struct xfs_btree_cur *cur, in xfs_inobt_recs_inorder() argument
435 struct xfs_btree_cur *cur; in xfs_inobt_init_common() local
437 cur = xfs_btree_alloc_cursor(mp, tp, btnum, in xfs_inobt_init_common()
440 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_ibt_2); in xfs_inobt_init_common()
441 cur->bc_ops = &xfs_inobt_ops; in xfs_inobt_init_common()
443 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_fibt_2); in xfs_inobt_init_common()
444 cur->bc_ops = &xfs_finobt_ops; in xfs_inobt_init_common()
448 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_inobt_init_common()
452 cur->bc_ag.pag = pag; in xfs_inobt_init_common()
453 return cur; in xfs_inobt_init_common()
465 struct xfs_btree_cur *cur; in xfs_inobt_init_cursor() local
468 cur = xfs_inobt_init_common(mp, tp, pag, btnum); in xfs_inobt_init_cursor()
470 cur->bc_nlevels = be32_to_cpu(agi->agi_level); in xfs_inobt_init_cursor()
472 cur->bc_nlevels = be32_to_cpu(agi->agi_free_level); in xfs_inobt_init_cursor()
473 cur->bc_ag.agbp = agbp; in xfs_inobt_init_cursor()
474 return cur; in xfs_inobt_init_cursor()
485 struct xfs_btree_cur *cur; in xfs_inobt_stage_cursor() local
487 cur = xfs_inobt_init_common(mp, NULL, pag, btnum); in xfs_inobt_stage_cursor()
488 xfs_btree_stage_afakeroot(cur, afake); in xfs_inobt_stage_cursor()
489 return cur; in xfs_inobt_stage_cursor()
498 struct xfs_btree_cur *cur, in xfs_inobt_commit_staged_btree() argument
503 struct xbtree_afakeroot *afake = cur->bc_ag.afake; in xfs_inobt_commit_staged_btree()
506 ASSERT(cur->bc_flags & XFS_BTREE_STAGING); in xfs_inobt_commit_staged_btree()
508 if (cur->bc_btnum == XFS_BTNUM_INO) { in xfs_inobt_commit_staged_btree()
512 if (xfs_has_inobtcounts(cur->bc_mp)) { in xfs_inobt_commit_staged_btree()
517 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_inobt_ops); in xfs_inobt_commit_staged_btree()
522 if (xfs_has_inobtcounts(cur->bc_mp)) { in xfs_inobt_commit_staged_btree()
527 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_finobt_ops); in xfs_inobt_commit_staged_btree()
719 struct xfs_btree_cur *cur; in xfs_inobt_cur() local
729 cur = xfs_inobt_init_cursor(mp, tp, *agi_bpp, pag, which); in xfs_inobt_cur()
730 *curpp = cur; in xfs_inobt_cur()
743 struct xfs_btree_cur *cur = NULL; in xfs_inobt_count_blocks() local
746 error = xfs_inobt_cur(mp, tp, pag, btnum, &cur, &agbp); in xfs_inobt_count_blocks()
750 error = xfs_btree_count_blocks(cur, tree_blocks); in xfs_inobt_count_blocks()
751 xfs_btree_del_cursor(cur, error); in xfs_inobt_count_blocks()