xfs: refactor dfops init to attach to transaction
Most callers of xfs_defer_init() immediately attach the dfops structure to a transaction. Add a transaction parameter to eliminate much of this boilerplate code. This also helps self-document the fact that many codepaths now expect a dfops pointer implicitly via xfs_trans->t_dfops. 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:

committed by
Darrick J. Wong

parent
d5669ed581
commit
bcd2c9f335
@@ -480,7 +480,7 @@ xfs_attr_rmtval_set(
|
||||
* extent and then crash then the block may not contain the
|
||||
* correct metadata after log recovery occurs.
|
||||
*/
|
||||
xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
||||
xfs_defer_init(NULL, args->trans->t_dfops, args->firstblock);
|
||||
nmap = 1;
|
||||
error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
|
||||
blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
|
||||
@@ -522,7 +522,7 @@ xfs_attr_rmtval_set(
|
||||
|
||||
ASSERT(blkcnt > 0);
|
||||
|
||||
xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
||||
xfs_defer_init(NULL, args->trans->t_dfops, args->firstblock);
|
||||
nmap = 1;
|
||||
error = xfs_bmapi_read(dp, (xfs_fileoff_t)lblkno,
|
||||
blkcnt, &map, &nmap,
|
||||
@@ -626,7 +626,7 @@ xfs_attr_rmtval_remove(
|
||||
blkcnt = args->rmtblkcnt;
|
||||
done = 0;
|
||||
while (!done) {
|
||||
xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
||||
xfs_defer_init(NULL, args->trans->t_dfops, args->firstblock);
|
||||
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
|
||||
XFS_BMAPI_ATTRFORK, 1, args->firstblock,
|
||||
&done);
|
||||
|
Reference in New Issue
Block a user