From 9e28a242be65b8274742425ca5d146f366205a90 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Tue, 24 Jul 2018 13:43:15 -0700 Subject: xfs: drop unnecessary xfs_defer_finish() dfops parameter Every caller of xfs_defer_finish() now passes the transaction and its associated ->t_dfops. The xfs_defer_ops parameter is therefore no longer necessary and can be removed. Since most xfs_defer_finish() callers also have to consider xfs_defer_cancel() on error, update the latter to also receive the transaction for consistency. The log recovery code contains an outlier case that cancels a dfops directly without an available transaction. Retain an internal wrapper to support this outlier case for the time being. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'fs/xfs/libxfs/xfs_attr.c') diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 3e98f0af389c..3deb5cdadf08 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -322,7 +322,7 @@ xfs_attr_set( xfs_trans_bhold(args.trans, leaf_bp); xfs_defer_bjoin(args.trans->t_dfops, leaf_bp); xfs_defer_ijoin(args.trans->t_dfops, dp); - error = xfs_defer_finish(&args.trans, args.trans->t_dfops); + error = xfs_defer_finish(&args.trans); if (error) goto out; @@ -591,7 +591,7 @@ xfs_attr_leaf_addname( if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; @@ -680,7 +680,7 @@ xfs_attr_leaf_addname( if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; } @@ -698,7 +698,7 @@ xfs_attr_leaf_addname( } return error; out_defer_cancel: - xfs_defer_cancel(args->trans->t_dfops); + xfs_defer_cancel(args->trans); return error; } @@ -744,13 +744,13 @@ xfs_attr_leaf_removename( if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; } return 0; out_defer_cancel: - xfs_defer_cancel(args->trans->t_dfops); + xfs_defer_cancel(args->trans); return error; } @@ -871,8 +871,7 @@ restart: if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, - args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; @@ -897,7 +896,7 @@ restart: if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; } else { @@ -994,7 +993,7 @@ restart: if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; } @@ -1023,7 +1022,7 @@ out: return error; return retval; out_defer_cancel: - xfs_defer_cancel(args->trans->t_dfops); + xfs_defer_cancel(args->trans); goto out; } @@ -1118,7 +1117,7 @@ xfs_attr_node_removename( if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; /* @@ -1150,7 +1149,7 @@ xfs_attr_node_removename( if (error) goto out_defer_cancel; xfs_defer_ijoin(args->trans->t_dfops, dp); - error = xfs_defer_finish(&args->trans, args->trans->t_dfops); + error = xfs_defer_finish(&args->trans); if (error) goto out_defer_cancel; } else @@ -1162,7 +1161,7 @@ out: xfs_da_state_free(state); return error; out_defer_cancel: - xfs_defer_cancel(args->trans->t_dfops); + xfs_defer_cancel(args->trans); goto out; } -- cgit v1.2.3