xfs: remove xfs_bunmapi() firstblock param

All callers pass ->t_firstblock from the current transaction.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Brian Foster 2018-07-11 22:26:25 -07:00 committed by Darrick J. Wong
parent a7beabeae2
commit 2af5284253
9 changed files with 22 additions and 32 deletions

View File

@ -631,8 +631,7 @@ xfs_attr_rmtval_remove(
xfs_defer_init(args->trans, args->trans->t_dfops, xfs_defer_init(args->trans, args->trans->t_dfops,
&args->trans->t_firstblock); &args->trans->t_firstblock);
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
XFS_BMAPI_ATTRFORK, 1, XFS_BMAPI_ATTRFORK, 1, &done);
&args->trans->t_firstblock, &done);
if (error) if (error)
goto out_defer_cancel; goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, args->dp); xfs_defer_ijoin(args->trans->t_dfops, args->dp);

View File

@ -5122,9 +5122,7 @@ __xfs_bunmapi(
xfs_fileoff_t start, /* first file offset deleted */ xfs_fileoff_t start, /* first file offset deleted */
xfs_filblks_t *rlen, /* i/o: amount remaining */ xfs_filblks_t *rlen, /* i/o: amount remaining */
int flags, /* misc flags */ int flags, /* misc flags */
xfs_extnum_t nexts, /* number of extents max */ xfs_extnum_t nexts) /* number of extents max */
xfs_fsblock_t *firstblock) /* first allocated block
controls a.g. for allocs */
{ {
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 */
@ -5198,7 +5196,7 @@ __xfs_bunmapi(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
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 = tp->t_firstblock;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
} else } else
cur = NULL; cur = NULL;
@ -5314,7 +5312,7 @@ __xfs_bunmapi(
del.br_state = XFS_EXT_UNWRITTEN; del.br_state = XFS_EXT_UNWRITTEN;
error = xfs_bmap_add_extent_unwritten_real(tp, ip, error = xfs_bmap_add_extent_unwritten_real(tp, ip,
whichfork, &icur, &cur, &del, whichfork, &icur, &cur, &del,
firstblock, &logflags); &tp->t_firstblock, &logflags);
if (error) if (error)
goto error0; goto error0;
goto nodelete; goto nodelete;
@ -5371,7 +5369,8 @@ __xfs_bunmapi(
prev.br_state = XFS_EXT_UNWRITTEN; prev.br_state = XFS_EXT_UNWRITTEN;
error = xfs_bmap_add_extent_unwritten_real(tp, error = xfs_bmap_add_extent_unwritten_real(tp,
ip, whichfork, &icur, &cur, ip, whichfork, &icur, &cur,
&prev, firstblock, &logflags); &prev, &tp->t_firstblock,
&logflags);
if (error) if (error)
goto error0; goto error0;
goto nodelete; goto nodelete;
@ -5380,7 +5379,8 @@ __xfs_bunmapi(
del.br_state = XFS_EXT_UNWRITTEN; del.br_state = XFS_EXT_UNWRITTEN;
error = xfs_bmap_add_extent_unwritten_real(tp, error = xfs_bmap_add_extent_unwritten_real(tp,
ip, whichfork, &icur, &cur, ip, whichfork, &icur, &cur,
&del, firstblock, &logflags); &del, &tp->t_firstblock,
&logflags);
if (error) if (error)
goto error0; goto error0;
goto nodelete; goto nodelete;
@ -5427,8 +5427,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, firstblock, &cur, 0, error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock,
&tmp_logflags, whichfork); &cur, 0, &tmp_logflags, whichfork);
logflags |= tmp_logflags; logflags |= tmp_logflags;
if (error) if (error)
goto error0; goto error0;
@ -5467,7 +5467,7 @@ __xfs_bunmapi(
xfs_trans_log_inode(tp, ip, logflags); xfs_trans_log_inode(tp, ip, logflags);
if (cur) { if (cur) {
if (!error) { if (!error) {
*firstblock = cur->bc_private.b.firstblock; tp->t_firstblock = cur->bc_private.b.firstblock;
cur->bc_private.b.allocated = 0; cur->bc_private.b.allocated = 0;
} }
xfs_btree_del_cursor(cur, xfs_btree_del_cursor(cur,
@ -5485,12 +5485,11 @@ xfs_bunmapi(
xfs_filblks_t len, xfs_filblks_t len,
int flags, int flags,
xfs_extnum_t nexts, xfs_extnum_t nexts,
xfs_fsblock_t *firstblock,
int *done) int *done)
{ {
int error; int error;
error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts, firstblock); error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts);
*done = (len == 0); *done = (len == 0);
return error; return error;
} }
@ -6148,7 +6147,7 @@ xfs_bmap_finish_one(
break; break;
case XFS_BMAP_UNMAP: case XFS_BMAP_UNMAP:
error = __xfs_bunmapi(tp, ip, startoff, blockcount, error = __xfs_bunmapi(tp, ip, startoff, blockcount,
XFS_BMAPI_REMAP, 1, &tp->t_firstblock); XFS_BMAPI_REMAP, 1);
break; break;
default: default:
ASSERT(0); ASSERT(0);

View File

@ -204,11 +204,10 @@ int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap); xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap);
int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags, xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags,
xfs_extnum_t nexts, xfs_fsblock_t *firstblock); xfs_extnum_t nexts);
int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t len, int flags, xfs_fileoff_t bno, xfs_filblks_t len, int flags,
xfs_extnum_t nexts, xfs_fsblock_t *firstblock, xfs_extnum_t nexts, int *done);
int *done);
int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork, int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got, struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
struct xfs_bmbt_irec *del); struct xfs_bmbt_irec *del);

View File

@ -2392,8 +2392,7 @@ xfs_da_shrink_inode(
* the last block to the place we want to kill. * the last block to the place we want to kill.
*/ */
error = xfs_bunmapi(tp, dp, dead_blkno, count, error = xfs_bunmapi(tp, dp, dead_blkno, count,
xfs_bmapi_aflag(w), 0, &tp->t_firstblock, xfs_bmapi_aflag(w), 0, &done);
&done);
if (error == -ENOSPC) { if (error == -ENOSPC) {
if (w != XFS_DATA_FORK) if (w != XFS_DATA_FORK)
break; break;

View File

@ -656,8 +656,7 @@ xfs_dir2_shrink_inode(
da = xfs_dir2_db_to_da(args->geo, db); da = xfs_dir2_db_to_da(args->geo, db);
/* Unmap the fsblock(s). */ /* Unmap the fsblock(s). */
error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0, error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0, &done);
&tp->t_firstblock, &done);
if (error) { if (error) {
/* /*
* ENOSPC actually can happen if we're in a removename with no * ENOSPC actually can happen if we're in a removename with no

View File

@ -1041,8 +1041,7 @@ xfs_unmap_extent(
xfs_trans_ijoin(tp, ip, 0); xfs_trans_ijoin(tp, ip, 0);
xfs_defer_init(tp, &dfops, &tp->t_firstblock); xfs_defer_init(tp, &dfops, &tp->t_firstblock);
error = xfs_bunmapi(tp, ip, startoffset_fsb, len_fsb, 0, 2, error = xfs_bunmapi(tp, ip, startoffset_fsb, len_fsb, 0, 2, done);
&tp->t_firstblock, done);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;

View File

@ -1581,8 +1581,7 @@ xfs_itruncate_extents_flags(
while (!done) { while (!done) {
xfs_defer_init(tp, &dfops, &tp->t_firstblock); xfs_defer_init(tp, &dfops, &tp->t_firstblock);
error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags, error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags,
XFS_ITRUNC_MAX_EXTENTS, &tp->t_firstblock, XFS_ITRUNC_MAX_EXTENTS, &done);
&done);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;

View File

@ -696,8 +696,7 @@ xfs_reflink_end_cow(
/* Unmap the old blocks in the data fork. */ /* Unmap the old blocks in the data fork. */
xfs_defer_init(tp, &dfops, &tp->t_firstblock); xfs_defer_init(tp, &dfops, &tp->t_firstblock);
rlen = del.br_blockcount; rlen = del.br_blockcount;
error = __xfs_bunmapi(tp, ip, del.br_startoff, &rlen, 0, 1, error = __xfs_bunmapi(tp, ip, del.br_startoff, &rlen, 0, 1);
&tp->t_firstblock);
if (error) if (error)
goto out_defer; goto out_defer;
@ -1044,8 +1043,7 @@ xfs_reflink_remap_extent(
rlen = unmap_len; rlen = unmap_len;
while (rlen) { while (rlen) {
xfs_defer_init(tp, &dfops, &tp->t_firstblock); xfs_defer_init(tp, &dfops, &tp->t_firstblock);
error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1, error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1);
&tp->t_firstblock);
if (error) if (error)
goto out_defer; goto out_defer;

View File

@ -460,8 +460,7 @@ xfs_inactive_symlink_rmt(
/* /*
* Unmap the dead block(s) to the dfops. * Unmap the dead block(s) to the dfops.
*/ */
error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps, &tp->t_firstblock, error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps, &done);
&done);
if (error) if (error)
goto error_bmap_cancel; goto error_bmap_cancel;
ASSERT(done); ASSERT(done);