From: Brian Foster Date: Fri, 5 Oct 2018 02:36:08 +0000 (-0500) Subject: xfs: remove xfs_bunmapi() firstblock param X-Git-Tag: v4.19.0-rc0~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3c5f3ddf25fe0556666abc694da54b2c9b4da90;p=thirdparty%2Fxfsprogs-dev.git xfs: remove xfs_bunmapi() firstblock param Source kernel commit: 2af528425342dc8f696b28693c5e61587cd72b43 All callers pass ->t_firstblock from the current transaction. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 4b97085bb..d6ac356e8 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -626,8 +626,7 @@ xfs_attr_rmtval_remove( xfs_defer_init(args->trans, args->trans->t_dfops, &args->trans->t_firstblock); error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, - XFS_BMAPI_ATTRFORK, 1, - &args->trans->t_firstblock, &done); + XFS_BMAPI_ATTRFORK, 1, &done); if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, args->dp); diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index ab4df5768..200a25218 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -5113,9 +5113,7 @@ __xfs_bunmapi( xfs_fileoff_t start, /* first file offset deleted */ xfs_filblks_t *rlen, /* i/o: amount remaining */ int flags, /* misc flags */ - xfs_extnum_t nexts, /* number of extents max */ - xfs_fsblock_t *firstblock) /* first allocated block - controls a.g. for allocs */ + xfs_extnum_t nexts) /* number of extents max */ { struct xfs_btree_cur *cur; /* bmap btree cursor */ struct xfs_bmbt_irec del; /* extent being deleted */ @@ -5189,7 +5187,7 @@ __xfs_bunmapi( if (ifp->if_flags & XFS_IFBROOT) { ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); 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; } else cur = NULL; @@ -5305,7 +5303,7 @@ __xfs_bunmapi( del.br_state = XFS_EXT_UNWRITTEN; error = xfs_bmap_add_extent_unwritten_real(tp, ip, whichfork, &icur, &cur, &del, - firstblock, &logflags); + &tp->t_firstblock, &logflags); if (error) goto error0; goto nodelete; @@ -5362,7 +5360,8 @@ __xfs_bunmapi( prev.br_state = XFS_EXT_UNWRITTEN; error = xfs_bmap_add_extent_unwritten_real(tp, ip, whichfork, &icur, &cur, - &prev, firstblock, &logflags); + &prev, &tp->t_firstblock, + &logflags); if (error) goto error0; goto nodelete; @@ -5371,7 +5370,8 @@ __xfs_bunmapi( del.br_state = XFS_EXT_UNWRITTEN; error = xfs_bmap_add_extent_unwritten_real(tp, ip, whichfork, &icur, &cur, - &del, firstblock, &logflags); + &del, &tp->t_firstblock, + &logflags); if (error) goto error0; goto nodelete; @@ -5418,8 +5418,8 @@ nodelete: */ if (xfs_bmap_needs_btree(ip, whichfork)) { ASSERT(cur == NULL); - error = xfs_bmap_extents_to_btree(tp, ip, firstblock, &cur, 0, - &tmp_logflags, whichfork); + error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, + &cur, 0, &tmp_logflags, whichfork); logflags |= tmp_logflags; if (error) goto error0; @@ -5458,7 +5458,7 @@ error0: xfs_trans_log_inode(tp, ip, logflags); if (cur) { if (!error) { - *firstblock = cur->bc_private.b.firstblock; + tp->t_firstblock = cur->bc_private.b.firstblock; cur->bc_private.b.allocated = 0; } xfs_btree_del_cursor(cur, @@ -5476,12 +5476,11 @@ xfs_bunmapi( xfs_filblks_t len, int flags, xfs_extnum_t nexts, - xfs_fsblock_t *firstblock, int *done) { int error; - error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts, firstblock); + error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts); *done = (len == 0); return error; } @@ -6139,7 +6138,7 @@ xfs_bmap_finish_one( break; case XFS_BMAP_UNMAP: error = __xfs_bunmapi(tp, ip, startoff, blockcount, - XFS_BMAPI_REMAP, 1, &tp->t_firstblock); + XFS_BMAPI_REMAP, 1); break; default: ASSERT(0); diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h index 88c2b5dc4..108a3073d 100644 --- a/libxfs/xfs_bmap.h +++ b/libxfs/xfs_bmap.h @@ -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); int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, 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, xfs_fileoff_t bno, xfs_filblks_t len, int flags, - xfs_extnum_t nexts, xfs_fsblock_t *firstblock, - int *done); + xfs_extnum_t nexts, int *done); int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork, struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got, struct xfs_bmbt_irec *del); diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 4541961b6..fa2bd4fbc 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -2387,8 +2387,7 @@ xfs_da_shrink_inode( * the last block to the place we want to kill. */ error = xfs_bunmapi(tp, dp, dead_blkno, count, - xfs_bmapi_aflag(w), 0, &tp->t_firstblock, - &done); + xfs_bmapi_aflag(w), 0, &done); if (error == -ENOSPC) { if (w != XFS_DATA_FORK) break; diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 0e2f59fd2..8fade6901 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -654,8 +654,7 @@ xfs_dir2_shrink_inode( da = xfs_dir2_db_to_da(args->geo, db); /* Unmap the fsblock(s). */ - error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0, - &tp->t_firstblock, &done); + error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0, &done); if (error) { /* * ENOSPC actually can happen if we're in a removename with no diff --git a/repair/phase6.c b/repair/phase6.c index 420d3b177..550f6892f 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1385,7 +1385,7 @@ longform_dir2_rebuild( /* free all data, leaf, node and freespace blocks */ error = -libxfs_bunmapi(tp, ip, 0, lastblock, XFS_BMAPI_METADATA, 0, - &firstblock, &done); + &done); if (error) { do_warn(_("xfs_bunmapi failed -- error - %d\n"), error); goto out_bmap_cancel;