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>
This commit is contained in:
Brian Foster 2015-08-19 09:50:13 +10:00 committed by Dave Chinner
parent 5e4b5386a2
commit d43ac29be7
2 changed files with 14 additions and 2 deletions

View file

@ -1019,9 +1019,10 @@ xfs_trans_cancel(
* chunk we've been working on and get a new transaction to continue. * chunk we've been working on and get a new transaction to continue.
*/ */
int int
xfs_trans_roll( __xfs_trans_roll(
struct xfs_trans **tpp, struct xfs_trans **tpp,
struct xfs_inode *dp) struct xfs_inode *dp,
int *committed)
{ {
struct xfs_trans *trans; struct xfs_trans *trans;
struct xfs_trans_res tres; struct xfs_trans_res tres;
@ -1052,6 +1053,7 @@ xfs_trans_roll(
if (error) if (error)
return error; return error;
*committed = 1;
trans = *tpp; trans = *tpp;
/* /*
@ -1074,3 +1076,12 @@ xfs_trans_roll(
xfs_trans_ijoin(trans, dp, 0); xfs_trans_ijoin(trans, dp, 0);
return 0; return 0;
} }
int
xfs_trans_roll(
struct xfs_trans **tpp,
struct xfs_inode *dp)
{
int committed = 0;
return __xfs_trans_roll(tpp, dp, &committed);
}

View file

@ -225,6 +225,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *,
xfs_fsblock_t, xfs_fsblock_t,
xfs_extlen_t); xfs_extlen_t);
int xfs_trans_commit(struct xfs_trans *); int xfs_trans_commit(struct xfs_trans *);
int __xfs_trans_roll(struct xfs_trans **, struct xfs_inode *, int *);
int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
void xfs_trans_cancel(xfs_trans_t *); void xfs_trans_cancel(xfs_trans_t *);
int xfs_trans_ail_init(struct xfs_mount *); int xfs_trans_ail_init(struct xfs_mount *);