Commit 280253d2 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: remove bmap format helpers firstblock params

The bmap format helpers receive firstblock via ->t_firstblock. Drop
the param and access it directly.
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 92f9da30
...@@ -646,7 +646,6 @@ STATIC int /* error */ ...@@ -646,7 +646,6 @@ STATIC int /* error */
xfs_bmap_extents_to_btree( xfs_bmap_extents_to_btree(
struct xfs_trans *tp, /* transaction pointer */ struct xfs_trans *tp, /* transaction pointer */
struct xfs_inode *ip, /* incore inode pointer */ struct xfs_inode *ip, /* incore inode pointer */
xfs_fsblock_t *firstblock, /* first-block-allocated */
struct xfs_btree_cur **curp, /* cursor returned to caller */ struct xfs_btree_cur **curp, /* cursor returned to caller */
int wasdel, /* converting a delayed alloc */ int wasdel, /* converting a delayed alloc */
int *logflagsp, /* inode logging flags */ int *logflagsp, /* inode logging flags */
...@@ -689,7 +688,7 @@ xfs_bmap_extents_to_btree( ...@@ -689,7 +688,7 @@ xfs_bmap_extents_to_btree(
* Need a cursor. Can't allocate until bb_level is filled in. * Need a cursor. Can't allocate until bb_level is filled in.
*/ */
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 = tp->t_firstblock;
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.
...@@ -699,16 +698,16 @@ xfs_bmap_extents_to_btree( ...@@ -699,16 +698,16 @@ xfs_bmap_extents_to_btree(
args.tp = tp; args.tp = tp;
args.mp = mp; args.mp = mp;
xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork); xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
args.firstblock = *firstblock; args.firstblock = tp->t_firstblock;
if (*firstblock == NULLFSBLOCK) { if (tp->t_firstblock == NULLFSBLOCK) {
args.type = XFS_ALLOCTYPE_START_BNO; args.type = XFS_ALLOCTYPE_START_BNO;
args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino); args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino);
} else if (tp->t_dfops->dop_low) { } else if (tp->t_dfops->dop_low) {
args.type = XFS_ALLOCTYPE_START_BNO; args.type = XFS_ALLOCTYPE_START_BNO;
args.fsbno = *firstblock; args.fsbno = tp->t_firstblock;
} else { } else {
args.type = XFS_ALLOCTYPE_NEAR_BNO; args.type = XFS_ALLOCTYPE_NEAR_BNO;
args.fsbno = *firstblock; args.fsbno = tp->t_firstblock;
} }
args.minlen = args.maxlen = args.prod = 1; args.minlen = args.maxlen = args.prod = 1;
args.wasdel = wasdel; args.wasdel = wasdel;
...@@ -731,9 +730,9 @@ xfs_bmap_extents_to_btree( ...@@ -731,9 +730,9 @@ xfs_bmap_extents_to_btree(
/* /*
* Allocation can't fail, the space was reserved. * Allocation can't fail, the space was reserved.
*/ */
ASSERT(*firstblock == NULLFSBLOCK || ASSERT(tp->t_firstblock == NULLFSBLOCK ||
args.agno >= XFS_FSB_TO_AGNO(mp, *firstblock)); args.agno >= XFS_FSB_TO_AGNO(mp, tp->t_firstblock));
*firstblock = cur->bc_private.b.firstblock = args.fsbno; tp->t_firstblock = cur->bc_private.b.firstblock = args.fsbno;
cur->bc_private.b.allocated++; cur->bc_private.b.allocated++;
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);
...@@ -810,7 +809,6 @@ STATIC int /* error */ ...@@ -810,7 +809,6 @@ STATIC int /* error */
xfs_bmap_local_to_extents( xfs_bmap_local_to_extents(
xfs_trans_t *tp, /* transaction pointer */ xfs_trans_t *tp, /* transaction pointer */
xfs_inode_t *ip, /* incore inode pointer */ xfs_inode_t *ip, /* incore inode pointer */
xfs_fsblock_t *firstblock, /* first block allocated in xaction */
xfs_extlen_t total, /* total blocks needed by transaction */ xfs_extlen_t total, /* total blocks needed by transaction */
int *logflagsp, /* inode logging flags */ int *logflagsp, /* inode logging flags */
int whichfork, int whichfork,
...@@ -848,16 +846,16 @@ xfs_bmap_local_to_extents( ...@@ -848,16 +846,16 @@ xfs_bmap_local_to_extents(
args.tp = tp; args.tp = tp;
args.mp = ip->i_mount; args.mp = ip->i_mount;
xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0); xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
args.firstblock = *firstblock; args.firstblock = tp->t_firstblock;
/* /*
* Allocate a block. We know we need only one, since the * Allocate a block. We know we need only one, since the
* file currently fits in an inode. * file currently fits in an inode.
*/ */
if (*firstblock == NULLFSBLOCK) { if (tp->t_firstblock == NULLFSBLOCK) {
args.fsbno = XFS_INO_TO_FSB(args.mp, ip->i_ino); args.fsbno = XFS_INO_TO_FSB(args.mp, ip->i_ino);
args.type = XFS_ALLOCTYPE_START_BNO; args.type = XFS_ALLOCTYPE_START_BNO;
} else { } else {
args.fsbno = *firstblock; args.fsbno = tp->t_firstblock;
args.type = XFS_ALLOCTYPE_NEAR_BNO; args.type = XFS_ALLOCTYPE_NEAR_BNO;
} }
args.total = total; args.total = total;
...@@ -869,7 +867,7 @@ xfs_bmap_local_to_extents( ...@@ -869,7 +867,7 @@ xfs_bmap_local_to_extents(
/* Can't fail, the space was reserved. */ /* Can't fail, the space was reserved. */
ASSERT(args.fsbno != NULLFSBLOCK); ASSERT(args.fsbno != NULLFSBLOCK);
ASSERT(args.len == 1); ASSERT(args.len == 1);
*firstblock = args.fsbno; tp->t_firstblock = args.fsbno;
bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0); bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0);
/* /*
...@@ -964,8 +962,8 @@ xfs_bmap_add_attrfork_extents( ...@@ -964,8 +962,8 @@ xfs_bmap_add_attrfork_extents(
if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip)) if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip))
return 0; return 0;
cur = NULL; cur = NULL;
error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, &cur, 0, error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
flags, XFS_DATA_FORK); XFS_DATA_FORK);
if (cur) { if (cur) {
cur->bc_private.b.allocated = 0; cur->bc_private.b.allocated = 0;
xfs_btree_del_cursor(cur, xfs_btree_del_cursor(cur,
...@@ -1007,8 +1005,8 @@ xfs_bmap_add_attrfork_local( ...@@ -1007,8 +1005,8 @@ xfs_bmap_add_attrfork_local(
} }
if (S_ISLNK(VFS_I(ip)->i_mode)) if (S_ISLNK(VFS_I(ip)->i_mode))
return xfs_bmap_local_to_extents(tp, ip, &tp->t_firstblock, 1, return xfs_bmap_local_to_extents(tp, ip, 1, flags,
flags, XFS_DATA_FORK, XFS_DATA_FORK,
xfs_symlink_local_to_remote); xfs_symlink_local_to_remote);
/* should only be called for types that support local format data */ /* should only be called for types that support local format data */
...@@ -1794,8 +1792,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1794,8 +1792,7 @@ xfs_bmap_add_extent_delay_real(
if (xfs_bmap_needs_btree(bma->ip, whichfork)) { if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
&bma->tp->t_firstblock, &bma->cur, 1, &bma->cur, 1, &tmp_rval, whichfork);
&tmp_rval, whichfork);
rval |= tmp_rval; rval |= tmp_rval;
if (error) if (error)
goto done; goto done;
...@@ -1872,8 +1869,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1872,8 +1869,7 @@ xfs_bmap_add_extent_delay_real(
if (xfs_bmap_needs_btree(bma->ip, whichfork)) { if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
&bma->tp->t_firstblock, &bma->cur, 1, &tmp_rval, &bma->cur, 1, &tmp_rval, whichfork);
whichfork);
rval |= tmp_rval; rval |= tmp_rval;
if (error) if (error)
goto done; goto done;
...@@ -1953,8 +1949,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1953,8 +1949,7 @@ xfs_bmap_add_extent_delay_real(
if (xfs_bmap_needs_btree(bma->ip, whichfork)) { if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
&bma->tp->t_firstblock, &bma->cur, 1, &bma->cur, 1, &tmp_rval, whichfork);
&tmp_rval, whichfork);
rval |= tmp_rval; rval |= tmp_rval;
if (error) if (error)
goto done; goto done;
...@@ -1991,8 +1986,8 @@ xfs_bmap_add_extent_delay_real( ...@@ -1991,8 +1986,8 @@ xfs_bmap_add_extent_delay_real(
ASSERT(bma->cur == NULL); ASSERT(bma->cur == NULL);
error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
&bma->tp->t_firstblock, &bma->cur, da_old > 0, &bma->cur, da_old > 0, &tmp_logflags,
&tmp_logflags, whichfork); whichfork);
bma->logflags |= tmp_logflags; bma->logflags |= tmp_logflags;
if (error) if (error)
goto done; goto done;
...@@ -2472,8 +2467,8 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2472,8 +2467,8 @@ xfs_bmap_add_extent_unwritten_real(
int tmp_logflags; /* partial log flag return val */ int tmp_logflags; /* partial log flag return val */
ASSERT(cur == NULL); ASSERT(cur == NULL);
error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
&cur, 0, &tmp_logflags, whichfork); &tmp_logflags, whichfork);
*logflagsp |= tmp_logflags; *logflagsp |= tmp_logflags;
if (error) if (error)
goto done; goto done;
...@@ -2835,8 +2830,8 @@ xfs_bmap_add_extent_hole_real( ...@@ -2835,8 +2830,8 @@ xfs_bmap_add_extent_hole_real(
int tmp_logflags; /* partial log flag return val */ int tmp_logflags; /* partial log flag return val */
ASSERT(cur == NULL); ASSERT(cur == NULL);
error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, error = xfs_bmap_extents_to_btree(tp, ip, curp, 0,
curp, 0, &tmp_logflags, whichfork); &tmp_logflags, whichfork);
*logflagsp |= tmp_logflags; *logflagsp |= tmp_logflags;
cur = *curp; cur = *curp;
if (error) if (error)
...@@ -5423,8 +5418,8 @@ __xfs_bunmapi( ...@@ -5423,8 +5418,8 @@ __xfs_bunmapi(
*/ */
if (xfs_bmap_needs_btree(ip, whichfork)) { if (xfs_bmap_needs_btree(ip, whichfork)) {
ASSERT(cur == NULL); ASSERT(cur == NULL);
error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
&cur, 0, &tmp_logflags, whichfork); &tmp_logflags, whichfork);
logflags |= tmp_logflags; logflags |= tmp_logflags;
if (error) if (error)
goto error0; goto error0;
...@@ -5967,8 +5962,8 @@ xfs_bmap_split_extent_at( ...@@ -5967,8 +5962,8 @@ xfs_bmap_split_extent_at(
int tmp_logflags; /* partial log flag return val */ int tmp_logflags; /* partial log flag return val */
ASSERT(cur == NULL); ASSERT(cur == NULL);
error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
&cur, 0, &tmp_logflags, whichfork); &tmp_logflags, whichfork);
logflags |= tmp_logflags; logflags |= tmp_logflags;
} }
......
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