xfs: use ->t_firstblock for all xfs_bunmapi() callers
Convert all xfs_bunmapi() callers to ->t_firstblock. 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:
parent
650919f131
commit
372837978d
|
@ -6132,17 +6132,9 @@ xfs_bmap_finish_one(
|
||||||
xfs_filblks_t *blockcount,
|
xfs_filblks_t *blockcount,
|
||||||
xfs_exntst_t state)
|
xfs_exntst_t state)
|
||||||
{
|
{
|
||||||
xfs_fsblock_t firstfsb;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
/*
|
ASSERT(tp->t_firstblock == NULLFSBLOCK);
|
||||||
* firstfsb is tied to the transaction lifetime and is used to
|
|
||||||
* ensure correct AG locking order and schedule work item
|
|
||||||
* continuations. XFS_BUI_MAX_FAST_EXTENTS (== 1) restricts us
|
|
||||||
* to only making one bmap call per transaction, so it should
|
|
||||||
* be safe to have it as a local variable here.
|
|
||||||
*/
|
|
||||||
firstfsb = NULLFSBLOCK;
|
|
||||||
|
|
||||||
trace_xfs_bmap_deferred(tp->t_mountp,
|
trace_xfs_bmap_deferred(tp->t_mountp,
|
||||||
XFS_FSB_TO_AGNO(tp->t_mountp, startblock), type,
|
XFS_FSB_TO_AGNO(tp->t_mountp, startblock), type,
|
||||||
|
@ -6165,7 +6157,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, &firstfsb);
|
XFS_BMAPI_REMAP, 1, &tp->t_firstblock);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
|
|
@ -1024,7 +1024,6 @@ xfs_unmap_extent(
|
||||||
struct xfs_mount *mp = ip->i_mount;
|
struct xfs_mount *mp = ip->i_mount;
|
||||||
struct xfs_trans *tp;
|
struct xfs_trans *tp;
|
||||||
struct xfs_defer_ops dfops;
|
struct xfs_defer_ops dfops;
|
||||||
xfs_fsblock_t firstfsb;
|
|
||||||
uint resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
|
uint resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
@ -1042,9 +1041,9 @@ xfs_unmap_extent(
|
||||||
|
|
||||||
xfs_trans_ijoin(tp, ip, 0);
|
xfs_trans_ijoin(tp, ip, 0);
|
||||||
|
|
||||||
xfs_defer_init(tp, &dfops, &firstfsb);
|
xfs_defer_init(tp, &dfops, &tp->t_firstblock);
|
||||||
error = xfs_bunmapi(tp, ip, startoffset_fsb, len_fsb, 0, 2, &firstfsb,
|
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;
|
||||||
|
|
||||||
|
|
|
@ -1543,7 +1543,6 @@ xfs_itruncate_extents_flags(
|
||||||
struct xfs_trans *tp = *tpp;
|
struct xfs_trans *tp = *tpp;
|
||||||
struct xfs_defer_ops *odfops = tp->t_dfops;
|
struct xfs_defer_ops *odfops = tp->t_dfops;
|
||||||
struct xfs_defer_ops dfops;
|
struct xfs_defer_ops dfops;
|
||||||
xfs_fsblock_t first_block;
|
|
||||||
xfs_fileoff_t first_unmap_block;
|
xfs_fileoff_t first_unmap_block;
|
||||||
xfs_fileoff_t last_block;
|
xfs_fileoff_t last_block;
|
||||||
xfs_filblks_t unmap_len;
|
xfs_filblks_t unmap_len;
|
||||||
|
@ -1580,9 +1579,9 @@ xfs_itruncate_extents_flags(
|
||||||
ASSERT(first_unmap_block < last_block);
|
ASSERT(first_unmap_block < last_block);
|
||||||
unmap_len = last_block - first_unmap_block + 1;
|
unmap_len = last_block - first_unmap_block + 1;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
xfs_defer_init(tp, &dfops, &first_block);
|
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, &first_block,
|
XFS_ITRUNC_MAX_EXTENTS, &tp->t_firstblock,
|
||||||
&done);
|
&done);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_bmap_cancel;
|
goto out_bmap_cancel;
|
||||||
|
|
|
@ -627,7 +627,6 @@ xfs_reflink_end_cow(
|
||||||
struct xfs_trans *tp;
|
struct xfs_trans *tp;
|
||||||
xfs_fileoff_t offset_fsb;
|
xfs_fileoff_t offset_fsb;
|
||||||
xfs_fileoff_t end_fsb;
|
xfs_fileoff_t end_fsb;
|
||||||
xfs_fsblock_t firstfsb;
|
|
||||||
struct xfs_defer_ops dfops;
|
struct xfs_defer_ops dfops;
|
||||||
int error;
|
int error;
|
||||||
unsigned int resblks;
|
unsigned int resblks;
|
||||||
|
@ -695,10 +694,10 @@ xfs_reflink_end_cow(
|
||||||
goto prev_extent;
|
goto prev_extent;
|
||||||
|
|
||||||
/* Unmap the old blocks in the data fork. */
|
/* Unmap the old blocks in the data fork. */
|
||||||
xfs_defer_init(tp, &dfops, &firstfsb);
|
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,
|
||||||
&firstfsb);
|
&tp->t_firstblock);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_defer;
|
goto out_defer;
|
||||||
|
|
||||||
|
@ -1002,7 +1001,6 @@ xfs_reflink_remap_extent(
|
||||||
struct xfs_mount *mp = ip->i_mount;
|
struct xfs_mount *mp = ip->i_mount;
|
||||||
bool real_extent = xfs_bmap_is_real_extent(irec);
|
bool real_extent = xfs_bmap_is_real_extent(irec);
|
||||||
struct xfs_trans *tp;
|
struct xfs_trans *tp;
|
||||||
xfs_fsblock_t firstfsb;
|
|
||||||
unsigned int resblks;
|
unsigned int resblks;
|
||||||
struct xfs_defer_ops dfops;
|
struct xfs_defer_ops dfops;
|
||||||
struct xfs_bmbt_irec uirec;
|
struct xfs_bmbt_irec uirec;
|
||||||
|
@ -1045,8 +1043,9 @@ xfs_reflink_remap_extent(
|
||||||
/* Unmap the old blocks in the data fork. */
|
/* Unmap the old blocks in the data fork. */
|
||||||
rlen = unmap_len;
|
rlen = unmap_len;
|
||||||
while (rlen) {
|
while (rlen) {
|
||||||
xfs_defer_init(tp, &dfops, &firstfsb);
|
xfs_defer_init(tp, &dfops, &tp->t_firstblock);
|
||||||
error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1, &firstfsb);
|
error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1,
|
||||||
|
&tp->t_firstblock);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_defer;
|
goto out_defer;
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,6 @@ xfs_inactive_symlink_rmt(
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
int done;
|
int done;
|
||||||
int error;
|
int error;
|
||||||
xfs_fsblock_t first_block;
|
|
||||||
struct xfs_defer_ops dfops;
|
struct xfs_defer_ops dfops;
|
||||||
int i;
|
int i;
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp;
|
||||||
|
@ -440,7 +439,7 @@ xfs_inactive_symlink_rmt(
|
||||||
* Find the block(s) so we can inval and unmap them.
|
* Find the block(s) so we can inval and unmap them.
|
||||||
*/
|
*/
|
||||||
done = 0;
|
done = 0;
|
||||||
xfs_defer_init(tp, &dfops, &first_block);
|
xfs_defer_init(tp, &dfops, &tp->t_firstblock);
|
||||||
nmaps = ARRAY_SIZE(mval);
|
nmaps = ARRAY_SIZE(mval);
|
||||||
error = xfs_bmapi_read(ip, 0, xfs_symlink_blocks(mp, size),
|
error = xfs_bmapi_read(ip, 0, xfs_symlink_blocks(mp, size),
|
||||||
mval, &nmaps, 0);
|
mval, &nmaps, 0);
|
||||||
|
@ -462,7 +461,8 @@ 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, &first_block, &done);
|
error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps, &tp->t_firstblock,
|
||||||
|
&done);
|
||||||
if (error)
|
if (error)
|
||||||
goto error_bmap_cancel;
|
goto error_bmap_cancel;
|
||||||
ASSERT(done);
|
ASSERT(done);
|
||||||
|
|
Loading…
Reference in New Issue