diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-16 22:25:32 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-10-19 21:45:15 +0300 |
commit | 56370ea6e5fe3e3d6e1ca2da58f95fb0d5e1779f (patch) | |
tree | 451401b83adf0d7f33a79fd96d791169b3fe2ee2 /fs/xfs/libxfs/xfs_bmap_btree.c | |
parent | 69724d920e7c30ca4421af615c499e92cfcc550b (diff) | |
download | linux-56370ea6e5fe3e3d6e1ca2da58f95fb0d5e1779f.tar.xz |
xfs: refactor btree cursor allocation function
Refactor btree allocation to a common helper.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap_btree.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index a43dea8d6a65..a06987e36db5 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -552,12 +552,8 @@ xfs_bmbt_init_cursor( struct xfs_btree_cur *cur; ASSERT(whichfork != XFS_COW_FORK); - cur = kmem_cache_zalloc(xfs_btree_cur_zone, GFP_NOFS | __GFP_NOFAIL); - - cur->bc_tp = tp; - cur->bc_mp = mp; + cur = xfs_btree_alloc_cursor(mp, tp, XFS_BTNUM_BMAP); cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; - cur->bc_btnum = XFS_BTNUM_BMAP; cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_bmbt_2); cur->bc_ops = &xfs_bmbt_ops; |