Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Foster and committed by
Dave Chinner
d43ac29b 5e4b5386

+14 -2
+13 -2
fs/xfs/xfs_trans.c
··· 1019 1019 * chunk we've been working on and get a new transaction to continue. 1020 1020 */ 1021 1021 int 1022 - xfs_trans_roll( 1022 + __xfs_trans_roll( 1023 1023 struct xfs_trans **tpp, 1024 - struct xfs_inode *dp) 1024 + struct xfs_inode *dp, 1025 + int *committed) 1025 1026 { 1026 1027 struct xfs_trans *trans; 1027 1028 struct xfs_trans_res tres; ··· 1053 1052 if (error) 1054 1053 return error; 1055 1054 1055 + *committed = 1; 1056 1056 trans = *tpp; 1057 1057 1058 1058 /* ··· 1075 1073 if (dp) 1076 1074 xfs_trans_ijoin(trans, dp, 0); 1077 1075 return 0; 1076 + } 1077 + 1078 + int 1079 + xfs_trans_roll( 1080 + struct xfs_trans **tpp, 1081 + struct xfs_inode *dp) 1082 + { 1083 + int committed = 0; 1084 + return __xfs_trans_roll(tpp, dp, &committed); 1078 1085 }
+1
fs/xfs/xfs_trans.h
··· 225 225 xfs_fsblock_t, 226 226 xfs_extlen_t); 227 227 int xfs_trans_commit(struct xfs_trans *); 228 + int __xfs_trans_roll(struct xfs_trans **, struct xfs_inode *, int *); 228 229 int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); 229 230 void xfs_trans_cancel(xfs_trans_t *); 230 231 int xfs_trans_ail_init(struct xfs_mount *);