aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr_remote.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-09-28 23:41:58 -0400
committerDave Chinner <david@fromorbit.com>2018-09-28 23:41:58 -0400
commitd5a2e2893da0d62c3888c91ae2da798adc17a9b9 (patch)
treedb2dcdff07f1ca24be625bb8b1e727b8d8f02547 /fs/xfs/libxfs/xfs_attr_remote.c
parentae29478766f4c8e16edca6fe1e25d73c47991ebe (diff)
xfs: remove last of unnecessary xfs_defer_cancel() callers
Now that deferred operations are completely managed via transactions, it's no longer necessary to cancel the dfops in error paths that already cancel the associated transaction. There are a few such calls lingering throughout the codebase. Remove all remaining unnecessary calls to xfs_defer_cancel(). This leaves xfs_defer_cancel() calls in two places. The first is the call in the transaction cancel path itself, which facilitates this patch. The second is made via the xfs_defer_finish() error path to provide consistent error semantics with transaction commit. For example, xfs_trans_commit() expects an xfs_defer_finish() failure to clean up the dfops structure before it returns. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr_remote.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr_remote.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index af094063e402..d89363c6b523 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -485,7 +485,7 @@ xfs_attr_rmtval_set(
485 blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map, 485 blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map,
486 &nmap); 486 &nmap);
487 if (error) 487 if (error)
488 goto out_defer_cancel; 488 return error;
489 error = xfs_defer_finish(&args->trans); 489 error = xfs_defer_finish(&args->trans);
490 if (error) 490 if (error)
491 return error; 491 return error;
@@ -553,9 +553,6 @@ xfs_attr_rmtval_set(
553 } 553 }
554 ASSERT(valuelen == 0); 554 ASSERT(valuelen == 0);
555 return 0; 555 return 0;
556out_defer_cancel:
557 xfs_defer_cancel(args->trans);
558 return error;
559} 556}
560 557
561/* 558/*
@@ -625,7 +622,7 @@ xfs_attr_rmtval_remove(
625 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, 622 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
626 XFS_BMAPI_ATTRFORK, 1, &done); 623 XFS_BMAPI_ATTRFORK, 1, &done);
627 if (error) 624 if (error)
628 goto out_defer_cancel; 625 return error;
629 error = xfs_defer_finish(&args->trans); 626 error = xfs_defer_finish(&args->trans);
630 if (error) 627 if (error)
631 return error; 628 return error;
@@ -638,7 +635,4 @@ xfs_attr_rmtval_remove(
638 return error; 635 return error;
639 } 636 }
640 return 0; 637 return 0;
641out_defer_cancel:
642 xfs_defer_cancel(args->trans);
643 return error;
644} 638}