Lines Matching refs:cur
164 struct xfs_btree_cur *cur) in xfs_bmbt_dup_cursor() argument
168 new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_bmbt_dup_cursor()
169 cur->bc_ino.ip, cur->bc_ino.whichfork); in xfs_bmbt_dup_cursor()
175 new->bc_ino.flags = cur->bc_ino.flags; in xfs_bmbt_dup_cursor()
196 struct xfs_btree_cur *cur, in xfs_bmbt_alloc_block() argument
205 args.tp = cur->bc_tp; in xfs_bmbt_alloc_block()
206 args.mp = cur->bc_mp; in xfs_bmbt_alloc_block()
207 args.fsbno = cur->bc_tp->t_firstblock; in xfs_bmbt_alloc_block()
208 xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino, in xfs_bmbt_alloc_block()
209 cur->bc_ino.whichfork); in xfs_bmbt_alloc_block()
226 } else if (cur->bc_tp->t_flags & XFS_TRANS_LOWMODE) { in xfs_bmbt_alloc_block()
233 args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL; in xfs_bmbt_alloc_block()
253 cur->bc_tp->t_flags |= XFS_TRANS_LOWMODE; in xfs_bmbt_alloc_block()
261 cur->bc_tp->t_firstblock = args.fsbno; in xfs_bmbt_alloc_block()
262 cur->bc_ino.allocated++; in xfs_bmbt_alloc_block()
263 cur->bc_ino.ip->i_d.di_nblocks++; in xfs_bmbt_alloc_block()
264 xfs_trans_log_inode(args.tp, cur->bc_ino.ip, XFS_ILOG_CORE); in xfs_bmbt_alloc_block()
265 xfs_trans_mod_dquot_byino(args.tp, cur->bc_ino.ip, in xfs_bmbt_alloc_block()
279 struct xfs_btree_cur *cur, in xfs_bmbt_free_block() argument
282 struct xfs_mount *mp = cur->bc_mp; in xfs_bmbt_free_block()
283 struct xfs_inode *ip = cur->bc_ino.ip; in xfs_bmbt_free_block()
284 struct xfs_trans *tp = cur->bc_tp; in xfs_bmbt_free_block()
288 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork); in xfs_bmbt_free_block()
289 xfs_bmap_add_free(cur->bc_tp, fsbno, 1, &oinfo); in xfs_bmbt_free_block()
299 struct xfs_btree_cur *cur, in xfs_bmbt_get_minrecs() argument
302 if (level == cur->bc_nlevels - 1) { in xfs_bmbt_get_minrecs()
305 ifp = XFS_IFORK_PTR(cur->bc_ino.ip, in xfs_bmbt_get_minrecs()
306 cur->bc_ino.whichfork); in xfs_bmbt_get_minrecs()
308 return xfs_bmbt_maxrecs(cur->bc_mp, in xfs_bmbt_get_minrecs()
312 return cur->bc_mp->m_bmap_dmnr[level != 0]; in xfs_bmbt_get_minrecs()
317 struct xfs_btree_cur *cur, in xfs_bmbt_get_maxrecs() argument
320 if (level == cur->bc_nlevels - 1) { in xfs_bmbt_get_maxrecs()
323 ifp = XFS_IFORK_PTR(cur->bc_ino.ip, in xfs_bmbt_get_maxrecs()
324 cur->bc_ino.whichfork); in xfs_bmbt_get_maxrecs()
326 return xfs_bmbt_maxrecs(cur->bc_mp, in xfs_bmbt_get_maxrecs()
330 return cur->bc_mp->m_bmap_dmxr[level != 0]; in xfs_bmbt_get_maxrecs()
345 struct xfs_btree_cur *cur, in xfs_bmbt_get_dmaxrecs() argument
348 if (level != cur->bc_nlevels - 1) in xfs_bmbt_get_dmaxrecs()
349 return cur->bc_mp->m_bmap_dmxr[level != 0]; in xfs_bmbt_get_dmaxrecs()
350 return xfs_bmdr_maxrecs(cur->bc_ino.forksize, level == 0); in xfs_bmbt_get_dmaxrecs()
374 struct xfs_btree_cur *cur, in xfs_bmbt_init_rec_from_cur() argument
377 xfs_bmbt_disk_set_all(&rec->bmbt, &cur->bc_rec.b); in xfs_bmbt_init_rec_from_cur()
382 struct xfs_btree_cur *cur, in xfs_bmbt_init_ptr_from_cur() argument
390 struct xfs_btree_cur *cur, in xfs_bmbt_key_diff() argument
394 cur->bc_rec.b.br_startoff; in xfs_bmbt_key_diff()
399 struct xfs_btree_cur *cur, in xfs_bmbt_diff_two_keys() argument
500 struct xfs_btree_cur *cur, in xfs_bmbt_keys_inorder() argument
510 struct xfs_btree_cur *cur, in xfs_bmbt_recs_inorder() argument
552 struct xfs_btree_cur *cur; in xfs_bmbt_init_cursor() local
555 cur = kmem_cache_zalloc(xfs_btree_cur_zone, GFP_NOFS | __GFP_NOFAIL); in xfs_bmbt_init_cursor()
557 cur->bc_tp = tp; in xfs_bmbt_init_cursor()
558 cur->bc_mp = mp; in xfs_bmbt_init_cursor()
559 cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; in xfs_bmbt_init_cursor()
560 cur->bc_btnum = XFS_BTNUM_BMAP; in xfs_bmbt_init_cursor()
561 cur->bc_blocklog = mp->m_sb.sb_blocklog; in xfs_bmbt_init_cursor()
562 cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_bmbt_2); in xfs_bmbt_init_cursor()
564 cur->bc_ops = &xfs_bmbt_ops; in xfs_bmbt_init_cursor()
565 cur->bc_flags = XFS_BTREE_LONG_PTRS | XFS_BTREE_ROOT_IN_INODE; in xfs_bmbt_init_cursor()
567 cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; in xfs_bmbt_init_cursor()
569 cur->bc_ino.forksize = XFS_IFORK_SIZE(ip, whichfork); in xfs_bmbt_init_cursor()
570 cur->bc_ino.ip = ip; in xfs_bmbt_init_cursor()
571 cur->bc_ino.allocated = 0; in xfs_bmbt_init_cursor()
572 cur->bc_ino.flags = 0; in xfs_bmbt_init_cursor()
573 cur->bc_ino.whichfork = whichfork; in xfs_bmbt_init_cursor()
575 return cur; in xfs_bmbt_init_cursor()
634 struct xfs_btree_cur *cur; in xfs_bmbt_change_owner() local
641 cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork); in xfs_bmbt_change_owner()
642 if (!cur) in xfs_bmbt_change_owner()
644 cur->bc_ino.flags |= XFS_BTCUR_BMBT_INVALID_OWNER; in xfs_bmbt_change_owner()
646 error = xfs_btree_change_owner(cur, new_owner, buffer_list); in xfs_bmbt_change_owner()
647 xfs_btree_del_cursor(cur, error); in xfs_bmbt_change_owner()