]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: return committed status from xfs_trans_roll()
authorBrian Foster <bfoster@redhat.com>
Tue, 18 Aug 2015 23:50:13 +0000 (09:50 +1000)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 9 Apr 2018 22:58:21 +0000 (15:58 -0700)
[ Upstream commit d43ac29be7a174f93a3d26cc1e68668fe86b782f ]

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.

Orabug: 27609404
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: wen.gang.wang@oracle.com
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans.h

index 77e3e0e3252bf7d10355372d716c410a94048f23..4aeb93255e659709c4bb77f36ab237e119330154 100644 (file)
@@ -1037,9 +1037,10 @@ xfs_trans_cancel(
  * chunk we've been working on and get a new transaction to continue.
  */
 int
-xfs_trans_roll(
+__xfs_trans_roll(
        struct xfs_trans        **tpp,
-       struct xfs_inode        *dp)
+       struct xfs_inode        *dp,
+       int                     *committed)
 {
        struct xfs_trans        *trans;
        struct xfs_trans_res    tres;
@@ -1070,6 +1071,7 @@ xfs_trans_roll(
        if (error)
                return error;
 
+       *committed = 1;
        trans = *tpp;
 
        /*
@@ -1099,3 +1101,12 @@ xfs_trans_roll(
                xfs_trans_ijoin(trans, dp, 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);
+}
index f48e839334af651c8ce8edea0779d2723fa7f4a9..ba1660b502a504a25a59d94bbd15c5ce2e9ed8fc 100644 (file)
@@ -225,6 +225,7 @@ void                xfs_trans_log_efd_extent(xfs_trans_t *,
                                         xfs_fsblock_t,
                                         xfs_extlen_t);
 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 *);
 void           xfs_trans_cancel(xfs_trans_t *);
 int            xfs_trans_ail_init(struct xfs_mount *);