Commit 42b394a9 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: remove xfs_btree_cur bmbt dfops field

All assignments of xfs_btree_cur.bc_private.b.dfops originate from
->t_dfops. Replace accesses of the former with the latter and remove
the unnecessary field. This patch does not change behavior.
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 81ba8f3e
...@@ -624,7 +624,7 @@ xfs_bmap_btree_to_extents( ...@@ -624,7 +624,7 @@ xfs_bmap_btree_to_extents(
if ((error = xfs_btree_check_block(cur, cblock, 0, cbp))) if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
return error; return error;
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork); xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
xfs_bmap_add_free(mp, cur->bc_private.b.dfops, cbno, 1, &oinfo); xfs_bmap_add_free(mp, cur->bc_tp->t_dfops, cbno, 1, &oinfo);
ip->i_d.di_nblocks--; ip->i_d.di_nblocks--;
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
xfs_trans_binval(tp, cbp); xfs_trans_binval(tp, cbp);
...@@ -690,7 +690,6 @@ xfs_bmap_extents_to_btree( ...@@ -690,7 +690,6 @@ xfs_bmap_extents_to_btree(
*/ */
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.firstblock = *firstblock;
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0; cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
/* /*
* Convert to a btree with two levels, one record in root. * Convert to a btree with two levels, one record in root.
...@@ -929,7 +928,6 @@ xfs_bmap_add_attrfork_btree( ...@@ -929,7 +928,6 @@ xfs_bmap_add_attrfork_btree(
*flags |= XFS_ILOG_DBROOT; *flags |= XFS_ILOG_DBROOT;
else { else {
cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK);
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.firstblock = *firstblock;
error = xfs_bmbt_lookup_first(cur, &stat); error = xfs_bmbt_lookup_first(cur, &stat);
if (error) if (error)
...@@ -4081,7 +4079,6 @@ xfs_bmapi_allocate( ...@@ -4081,7 +4079,6 @@ xfs_bmapi_allocate(
if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur) { if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur) {
bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork); bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork);
bma->cur->bc_private.b.firstblock = *bma->firstblock; bma->cur->bc_private.b.firstblock = *bma->firstblock;
bma->cur->bc_private.b.dfops = bma->tp->t_dfops;
} }
/* /*
* Bump the number of extents we've allocated * Bump the number of extents we've allocated
...@@ -4169,7 +4166,6 @@ xfs_bmapi_convert_unwritten( ...@@ -4169,7 +4166,6 @@ xfs_bmapi_convert_unwritten(
bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp, bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp,
bma->ip, whichfork); bma->ip, whichfork);
bma->cur->bc_private.b.firstblock = *bma->firstblock; bma->cur->bc_private.b.firstblock = *bma->firstblock;
bma->cur->bc_private.b.dfops = bma->tp->t_dfops;
} }
mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN) mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN)
? XFS_EXT_NORM : XFS_EXT_UNWRITTEN; ? XFS_EXT_NORM : XFS_EXT_UNWRITTEN;
...@@ -4558,7 +4554,6 @@ xfs_bmapi_remap( ...@@ -4558,7 +4554,6 @@ xfs_bmapi_remap(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = firstblock; cur->bc_private.b.firstblock = firstblock;
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
} }
...@@ -5149,7 +5144,6 @@ __xfs_bunmapi( ...@@ -5149,7 +5144,6 @@ __xfs_bunmapi(
xfs_fsblock_t *firstblock) /* first allocated block xfs_fsblock_t *firstblock) /* first allocated block
controls a.g. for allocs */ controls a.g. for allocs */
{ {
struct xfs_defer_ops *dfops = tp ? tp->t_dfops : NULL;
struct xfs_btree_cur *cur; /* bmap btree cursor */ struct xfs_btree_cur *cur; /* bmap btree cursor */
struct xfs_bmbt_irec del; /* extent being deleted */ struct xfs_bmbt_irec del; /* extent being deleted */
int error; /* error return value */ int error; /* error return value */
...@@ -5223,7 +5217,6 @@ __xfs_bunmapi( ...@@ -5223,7 +5217,6 @@ __xfs_bunmapi(
ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE);
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.firstblock = *firstblock;
cur->bc_private.b.dfops = dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
} else } else
cur = NULL; cur = NULL;
...@@ -5713,7 +5706,6 @@ xfs_bmap_collapse_extents( ...@@ -5713,7 +5706,6 @@ xfs_bmap_collapse_extents(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.firstblock = *firstblock;
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
} }
...@@ -5835,7 +5827,6 @@ xfs_bmap_insert_extents( ...@@ -5835,7 +5827,6 @@ xfs_bmap_insert_extents(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.firstblock = *firstblock;
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
} }
...@@ -5959,7 +5950,6 @@ xfs_bmap_split_extent_at( ...@@ -5959,7 +5950,6 @@ xfs_bmap_split_extent_at(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstfsb; cur->bc_private.b.firstblock = *firstfsb;
cur->bc_private.b.dfops = tp->t_dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
error = xfs_bmbt_lookup_eq(cur, &got, &i); error = xfs_bmbt_lookup_eq(cur, &got, &i);
if (error) if (error)
......
...@@ -176,7 +176,6 @@ xfs_bmbt_dup_cursor( ...@@ -176,7 +176,6 @@ xfs_bmbt_dup_cursor(
* since init cursor doesn't get them. * since init cursor doesn't get them.
*/ */
new->bc_private.b.firstblock = cur->bc_private.b.firstblock; new->bc_private.b.firstblock = cur->bc_private.b.firstblock;
new->bc_private.b.dfops = cur->bc_private.b.dfops;
new->bc_private.b.flags = cur->bc_private.b.flags; new->bc_private.b.flags = cur->bc_private.b.flags;
return new; return new;
...@@ -189,7 +188,6 @@ xfs_bmbt_update_cursor( ...@@ -189,7 +188,6 @@ xfs_bmbt_update_cursor(
{ {
ASSERT((dst->bc_private.b.firstblock != NULLFSBLOCK) || ASSERT((dst->bc_private.b.firstblock != NULLFSBLOCK) ||
(dst->bc_private.b.ip->i_d.di_flags & XFS_DIFLAG_REALTIME)); (dst->bc_private.b.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
ASSERT(dst->bc_private.b.dfops == src->bc_private.b.dfops);
dst->bc_private.b.allocated += src->bc_private.b.allocated; dst->bc_private.b.allocated += src->bc_private.b.allocated;
dst->bc_private.b.firstblock = src->bc_private.b.firstblock; dst->bc_private.b.firstblock = src->bc_private.b.firstblock;
...@@ -230,7 +228,7 @@ xfs_bmbt_alloc_block( ...@@ -230,7 +228,7 @@ xfs_bmbt_alloc_block(
* block allocation here and corrupt the filesystem. * block allocation here and corrupt the filesystem.
*/ */
args.minleft = args.tp->t_blk_res; args.minleft = args.tp->t_blk_res;
} else if (cur->bc_private.b.dfops->dop_low) { } else if (cur->bc_tp->t_dfops->dop_low) {
args.type = XFS_ALLOCTYPE_START_BNO; args.type = XFS_ALLOCTYPE_START_BNO;
} else { } else {
args.type = XFS_ALLOCTYPE_NEAR_BNO; args.type = XFS_ALLOCTYPE_NEAR_BNO;
...@@ -257,7 +255,7 @@ xfs_bmbt_alloc_block( ...@@ -257,7 +255,7 @@ xfs_bmbt_alloc_block(
error = xfs_alloc_vextent(&args); error = xfs_alloc_vextent(&args);
if (error) if (error)
goto error0; goto error0;
cur->bc_private.b.dfops->dop_low = true; cur->bc_tp->t_dfops->dop_low = true;
} }
if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) { if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) {
*stat = 0; *stat = 0;
...@@ -293,7 +291,7 @@ xfs_bmbt_free_block( ...@@ -293,7 +291,7 @@ xfs_bmbt_free_block(
struct xfs_owner_info oinfo; struct xfs_owner_info oinfo;
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_private.b.whichfork); xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_private.b.whichfork);
xfs_bmap_add_free(mp, cur->bc_private.b.dfops, fsbno, 1, &oinfo); xfs_bmap_add_free(mp, cur->bc_tp->t_dfops, fsbno, 1, &oinfo);
ip->i_d.di_nblocks--; ip->i_d.di_nblocks--;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
...@@ -565,7 +563,6 @@ xfs_bmbt_init_cursor( ...@@ -565,7 +563,6 @@ xfs_bmbt_init_cursor(
cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork);
cur->bc_private.b.ip = ip; cur->bc_private.b.ip = ip;
cur->bc_private.b.firstblock = NULLFSBLOCK; cur->bc_private.b.firstblock = NULLFSBLOCK;
cur->bc_private.b.dfops = NULL;
cur->bc_private.b.allocated = 0; cur->bc_private.b.allocated = 0;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
cur->bc_private.b.whichfork = whichfork; cur->bc_private.b.whichfork = whichfork;
......
...@@ -215,7 +215,6 @@ typedef struct xfs_btree_cur ...@@ -215,7 +215,6 @@ typedef struct xfs_btree_cur
} a; } a;
struct { /* needed for BMAP */ struct { /* needed for BMAP */
struct xfs_inode *ip; /* pointer to our inode */ struct xfs_inode *ip; /* pointer to our inode */
struct xfs_defer_ops *dfops; /* deferred updates */
xfs_fsblock_t firstblock; /* 1st blk allocated */ xfs_fsblock_t firstblock; /* 1st blk allocated */
int allocated; /* count of alloced */ int allocated; /* count of alloced */
short forksize; /* fork's inode space */ short forksize; /* fork's inode space */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment