Lines Matching refs:cur
26 struct xfs_btree_cur *cur, in xfs_inobt_get_minrecs() argument
29 return M_IGEO(cur->bc_mp)->inobt_mnr[level != 0]; in xfs_inobt_get_minrecs()
34 struct xfs_btree_cur *cur) in xfs_inobt_dup_cursor() argument
36 return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_inobt_dup_cursor()
37 cur->bc_ag.agbp, cur->bc_ag.agno, in xfs_inobt_dup_cursor()
38 cur->bc_btnum); in xfs_inobt_dup_cursor()
43 struct xfs_btree_cur *cur, in xfs_inobt_set_root() argument
47 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_inobt_set_root()
52 xfs_ialloc_log_agi(cur->bc_tp, agbp, XFS_AGI_ROOT | XFS_AGI_LEVEL); in xfs_inobt_set_root()
57 struct xfs_btree_cur *cur, in xfs_finobt_set_root() argument
61 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_finobt_set_root()
66 xfs_ialloc_log_agi(cur->bc_tp, agbp, in xfs_finobt_set_root()
73 struct xfs_btree_cur *cur, in xfs_inobt_mod_blockcount() argument
76 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_inobt_mod_blockcount()
79 if (!xfs_sb_version_hasinobtcounts(&cur->bc_mp->m_sb)) in xfs_inobt_mod_blockcount()
82 if (cur->bc_btnum == XFS_BTNUM_FINO) in xfs_inobt_mod_blockcount()
84 else if (cur->bc_btnum == XFS_BTNUM_INO) in xfs_inobt_mod_blockcount()
86 xfs_ialloc_log_agi(cur->bc_tp, agbp, XFS_AGI_IBLOCKS); in xfs_inobt_mod_blockcount()
91 struct xfs_btree_cur *cur, in __xfs_inobt_alloc_block() argument
102 args.tp = cur->bc_tp; in __xfs_inobt_alloc_block()
103 args.mp = cur->bc_mp; in __xfs_inobt_alloc_block()
105 args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_ag.agno, sbno); in __xfs_inobt_alloc_block()
124 xfs_inobt_mod_blockcount(cur, 1); in __xfs_inobt_alloc_block()
130 struct xfs_btree_cur *cur, in xfs_inobt_alloc_block() argument
135 return __xfs_inobt_alloc_block(cur, start, new, stat, XFS_AG_RESV_NONE); in xfs_inobt_alloc_block()
140 struct xfs_btree_cur *cur, in xfs_finobt_alloc_block() argument
145 if (cur->bc_mp->m_finobt_nores) in xfs_finobt_alloc_block()
146 return xfs_inobt_alloc_block(cur, start, new, stat); in xfs_finobt_alloc_block()
147 return __xfs_inobt_alloc_block(cur, start, new, stat, in xfs_finobt_alloc_block()
153 struct xfs_btree_cur *cur, in __xfs_inobt_free_block() argument
157 xfs_inobt_mod_blockcount(cur, -1); in __xfs_inobt_free_block()
158 return xfs_free_extent(cur->bc_tp, in __xfs_inobt_free_block()
159 XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)), 1, in __xfs_inobt_free_block()
165 struct xfs_btree_cur *cur, in xfs_inobt_free_block() argument
168 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_NONE); in xfs_inobt_free_block()
173 struct xfs_btree_cur *cur, in xfs_finobt_free_block() argument
176 if (cur->bc_mp->m_finobt_nores) in xfs_finobt_free_block()
177 return xfs_inobt_free_block(cur, bp); in xfs_finobt_free_block()
178 return __xfs_inobt_free_block(cur, bp, XFS_AG_RESV_METADATA); in xfs_finobt_free_block()
183 struct xfs_btree_cur *cur, in xfs_inobt_get_maxrecs() argument
186 return M_IGEO(cur->bc_mp)->inobt_mxr[level != 0]; in xfs_inobt_get_maxrecs()
211 struct xfs_btree_cur *cur, in xfs_inobt_init_rec_from_cur() argument
214 rec->inobt.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); in xfs_inobt_init_rec_from_cur()
215 if (xfs_sb_version_hassparseinodes(&cur->bc_mp->m_sb)) { in xfs_inobt_init_rec_from_cur()
217 cpu_to_be16(cur->bc_rec.i.ir_holemask); in xfs_inobt_init_rec_from_cur()
218 rec->inobt.ir_u.sp.ir_count = cur->bc_rec.i.ir_count; in xfs_inobt_init_rec_from_cur()
219 rec->inobt.ir_u.sp.ir_freecount = cur->bc_rec.i.ir_freecount; in xfs_inobt_init_rec_from_cur()
223 cpu_to_be32(cur->bc_rec.i.ir_freecount); in xfs_inobt_init_rec_from_cur()
225 rec->inobt.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); in xfs_inobt_init_rec_from_cur()
233 struct xfs_btree_cur *cur, in xfs_inobt_init_ptr_from_cur() argument
236 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_inobt_init_ptr_from_cur()
238 ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno)); in xfs_inobt_init_ptr_from_cur()
245 struct xfs_btree_cur *cur, in xfs_finobt_init_ptr_from_cur() argument
248 struct xfs_agi *agi = cur->bc_ag.agbp->b_addr; in xfs_finobt_init_ptr_from_cur()
250 ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno)); in xfs_finobt_init_ptr_from_cur()
256 struct xfs_btree_cur *cur, in xfs_inobt_key_diff() argument
260 cur->bc_rec.i.ir_startino; in xfs_inobt_key_diff()
265 struct xfs_btree_cur *cur, in xfs_inobt_diff_two_keys() argument
363 struct xfs_btree_cur *cur, in xfs_inobt_keys_inorder() argument
373 struct xfs_btree_cur *cur, in xfs_inobt_recs_inorder() argument
433 struct xfs_btree_cur *cur; in xfs_inobt_init_common() local
435 cur = kmem_cache_zalloc(xfs_btree_cur_zone, GFP_NOFS | __GFP_NOFAIL); in xfs_inobt_init_common()
436 cur->bc_tp = tp; in xfs_inobt_init_common()
437 cur->bc_mp = mp; in xfs_inobt_init_common()
438 cur->bc_btnum = 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()
447 cur->bc_blocklog = mp->m_sb.sb_blocklog; in xfs_inobt_init_common()
450 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_inobt_init_common()
452 cur->bc_ag.agno = agno; 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, agno, 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, agno, 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_sb_version_hasinobtcounts(&cur->bc_mp->m_sb)) { 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_sb_version_hasinobtcounts(&cur->bc_mp->m_sb)) { in xfs_inobt_commit_staged_btree()
527 xfs_btree_commit_afakeroot(cur, tp, agbp, &xfs_finobt_ops); in xfs_inobt_commit_staged_btree()
664 struct xfs_btree_cur *cur; in xfs_inobt_cur() local
674 cur = xfs_inobt_init_cursor(mp, tp, *agi_bpp, agno, which); in xfs_inobt_cur()
675 if (!cur) { in xfs_inobt_cur()
680 *curpp = cur; in xfs_inobt_cur()
693 struct xfs_btree_cur *cur = NULL; in xfs_inobt_count_blocks() local
696 error = xfs_inobt_cur(mp, tp, agno, btnum, &cur, &agbp); in xfs_inobt_count_blocks()
700 error = xfs_btree_count_blocks(cur, tree_blocks); in xfs_inobt_count_blocks()
701 xfs_btree_del_cursor(cur, error); in xfs_inobt_count_blocks()