aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2015-08-18 19:50:13 -0400
committerDave Chinner <david@fromorbit.com>2015-08-18 19:50:13 -0400
commitd43ac29be7a174f93a3d26cc1e68668fe86b782f (patch)
tree9fc18d10e330e9fda9ae1f3d2e1a84a850076c7b
parent5e4b5386a2c29429add601c8cfb45bb10d80c490 (diff)
xfs: return committed status from xfs_trans_roll()
Some callers need to make error handling decisions based on whether the current transaction successfully committed or not. Rename xfs_trans_roll(), add a new parameter and provide a wrapper to preserve existing callers. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/xfs_trans.c15
-rw-r--r--fs/xfs/xfs_trans.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 0582a27107d4..a0ab1dae9c31 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -1019,9 +1019,10 @@ xfs_trans_cancel(
1019 * chunk we've been working on and get a new transaction to continue. 1019 * chunk we've been working on and get a new transaction to continue.
1020 */ 1020 */
1021int 1021int
1022xfs_trans_roll( 1022__xfs_trans_roll(
1023 struct xfs_trans **tpp, 1023 struct xfs_trans **tpp,
1024 struct xfs_inode *dp) 1024 struct xfs_inode *dp,
1025 int *committed)
1025{ 1026{
1026 struct xfs_trans *trans; 1027 struct xfs_trans *trans;
1027 struct xfs_trans_res tres; 1028 struct xfs_trans_res tres;
@@ -1052,6 +1053,7 @@ xfs_trans_roll(
1052 if (error) 1053 if (error)
1053 return error; 1054 return error;
1054 1055
1056 *committed = 1;
1055 trans = *tpp; 1057 trans = *tpp;
1056 1058
1057 /* 1059 /*
@@ -1074,3 +1076,12 @@ xfs_trans_roll(
1074 xfs_trans_ijoin(trans, dp, 0); 1076 xfs_trans_ijoin(trans, dp, 0);
1075 return 0; 1077 return 0;
1076} 1078}
1079
1080int
1081xfs_trans_roll(
1082 struct xfs_trans **tpp,
1083 struct xfs_inode *dp)
1084{
1085 int committed = 0;
1086 return __xfs_trans_roll(tpp, dp, &committed);
1087}
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index f48e839334af..ba1660b502a5 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -225,6 +225,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *,
225 xfs_fsblock_t, 225 xfs_fsblock_t,
226 xfs_extlen_t); 226 xfs_extlen_t);
227int xfs_trans_commit(struct xfs_trans *); 227int xfs_trans_commit(struct xfs_trans *);
228int __xfs_trans_roll(struct xfs_trans **, struct xfs_inode *, int *);
228int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); 229int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
229void xfs_trans_cancel(xfs_trans_t *); 230void xfs_trans_cancel(xfs_trans_t *);
230int xfs_trans_ail_init(struct xfs_mount *); 231int xfs_trans_ail_init(struct xfs_mount *);