]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xfs: saner xfs_trans_commit interface
authorChristoph Hellwig <hch@lst.de>
Thu, 4 Jun 2015 03:48:08 +0000 (13:48 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 4 Jun 2015 03:48:08 +0000 (13:48 +1000)
The flags argument to xfs_trans_commit is not useful for most callers, as
a commit of a transaction without a permanent log reservation must pass
0 here, and all callers for a transaction with a permanent log reservation
except for xfs_trans_roll must pass XFS_TRANS_RELEASE_LOG_RES.  So remove
the flags argument from the public xfs_trans_commit interfaces, and
introduce low-level __xfs_trans_commit variant just for xfs_trans_roll
that regrants a log reservation instead of releasing it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
24 files changed:
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_shared.h
fs/xfs/xfs_aops.c
fs/xfs/xfs_attr_inactive.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_dquot.c
fs/xfs/xfs_file.c
fs/xfs/xfs_fsops.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_log.h
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_pnfs.c
fs/xfs/xfs_qm.c
fs/xfs/xfs_qm_syscalls.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_symlink.c
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans.h

index 126da7fc5dedaab11cc529814027243966c4927a..3349c9a1e84569201cb5df93ae39dd1941f72209 100644 (file)
@@ -320,8 +320,7 @@ xfs_attr_set(
                                xfs_trans_ichgtime(args.trans, dp,
                                                        XFS_ICHGTIME_CHG);
                        }
-                       err2 = xfs_trans_commit(args.trans,
-                                                XFS_TRANS_RELEASE_LOG_RES);
+                       err2 = xfs_trans_commit(args.trans);
                        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
                        return error ? error : err2;
@@ -383,7 +382,7 @@ xfs_attr_set(
         * Commit the last in the sequence of transactions.
         */
        xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
-       error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
        return error;
@@ -499,7 +498,7 @@ xfs_attr_remove(
         * Commit the last in the sequence of transactions.
         */
        xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
-       error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
        return error;
index a07055aaf433e8af8e439b0011a83c62294ce554..caca2c59de9633c3b9851e9ec4354d29c19e9a27 100644 (file)
@@ -1215,7 +1215,7 @@ xfs_bmap_add_attrfork(
        error = xfs_bmap_finish(&tp, &flist, &committed);
        if (error)
                goto bmap_cancel;
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
        return error;
 
@@ -5926,8 +5926,7 @@ xfs_bmap_split_extent(
        if (error)
                goto out;
 
-       return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
-
+       return xfs_trans_commit(tp);
 
 out:
        xfs_trans_cancel(tp);
index 3a5667d7cf24e074010c45f1d8530fc211a58143..fcc151f69a757cc927c2873c6c4c5dd09b487a42 100644 (file)
@@ -799,5 +799,5 @@ xfs_sync_sb(
        xfs_log_sb(tp);
        if (wait)
                xfs_trans_set_sync(tp);
-       return xfs_trans_commit(tp, 0);
+       return xfs_trans_commit(tp);
 }
index 930cc7d295ecc1cb24838a0f7fdebef3326a6791..5be529707903fb42bc4ebccc176e57b7a3470d96 100644 (file)
@@ -181,11 +181,6 @@ int        xfs_log_calc_minimum_size(struct xfs_mount *);
 #define XFS_TRANS_RESERVE      0x20    /* OK to use reserved data blocks */
 #define XFS_TRANS_FREEZE_PROT  0x40    /* Transaction has elevated writer
                                           count in superblock */
-/*
- * Values for call flags parameter.
- */
-#define        XFS_TRANS_RELEASE_LOG_RES       0x4
-
 /*
  * Field values for xfs_trans_mod_sb.
  */
index 3890a38a0f263aa864ce664b299296c3374ba2bd..7246a3936c6f1c86d6a8a687002eb634238a9dd6 100644 (file)
@@ -155,7 +155,7 @@ xfs_setfilesize(
        xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
        xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 
-       return xfs_trans_commit(tp, 0);
+       return xfs_trans_commit(tp);
 }
 
 STATIC int
index af7fce33ae5241c9e77cfba849df37e1a2c3792c..48f26ff088805c85f05b2634b5c56ffbe8b0f4f7 100644 (file)
@@ -438,7 +438,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
        if (error)
                goto out;
 
-       error = xfs_trans_commit(trans, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
        return error;
index 7e795cf60bd0e50539a5bc498aeb106608ac039e..1f0215d9a4714b440fadb34f59a8b99698dd2f0c 100644 (file)
@@ -893,8 +893,7 @@ xfs_free_eofblocks(
                         */
                        xfs_trans_cancel(tp);
                } else {
-                       error = xfs_trans_commit(tp,
-                                               XFS_TRANS_RELEASE_LOG_RES);
+                       error = xfs_trans_commit(tp);
                        if (!error)
                                xfs_inode_clear_eofblocks_tag(ip);
                }
@@ -1034,7 +1033,7 @@ xfs_alloc_file_space(
                        goto error0;
                }
 
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
                if (error) {
                        break;
@@ -1301,7 +1300,7 @@ xfs_free_file_space(
                        goto error0;
                }
 
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
        }
 
@@ -1473,7 +1472,7 @@ xfs_shift_file_space(
                if (error)
                        goto out;
 
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
        }
 
        return error;
@@ -1882,7 +1881,7 @@ xfs_swap_extents(
        if (mp->m_flags & XFS_MOUNT_WSYNC)
                xfs_trans_set_sync(tp);
 
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 
        trace_xfs_swap_extent_after(ip, 0);
        trace_xfs_swap_extent_after(tip, 1);
index ab0ae1f8b0eadd7c0ce73bfeff3c59f15a478730..4143dc75dca4b22b15003ebd1bce5b3561a5deb8 100644 (file)
@@ -666,7 +666,7 @@ xfs_qm_dqread(
        xfs_trans_brelse(tp, bp);
 
        if (tp) {
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
                if (error)
                        goto error0;
        }
index 46598b7bce86e3ebdb1fe1cbd15a0cc71d84a6b2..0dec85865ce4422286174bf192fe154ded631aa0 100644 (file)
@@ -160,7 +160,7 @@ xfs_update_prealloc_flags(
        xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        if (flags & XFS_PREALLOC_SYNC)
                xfs_trans_set_sync(tp);
-       return xfs_trans_commit(tp, 0);
+       return xfs_trans_commit(tp);
 }
 
 /*
index 0bdcdb74fc7662f39bfb1e7b40b174190b70d795..0932c15acb743826819634f237ba000962b585ee 100644 (file)
@@ -489,7 +489,7 @@ xfs_growfs_data_private(
        if (dpct)
                xfs_trans_mod_sb(tp, XFS_TRANS_SB_IMAXPCT, dpct);
        xfs_trans_set_sync(tp);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
        if (error)
                return error;
 
index 3f3f8a0e78376fa1de8aaa3c941bff2b7a34378e..63cd40022bf42933296d7859f4b7b08662c4b7a7 100644 (file)
@@ -1230,7 +1230,7 @@ xfs_create(
        if (error)
                goto out_bmap_cancel;
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out_release_inode;
 
@@ -1339,7 +1339,7 @@ xfs_create_tmpfile(
        if (error)
                goto out_trans_cancel;
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out_release_inode;
 
@@ -1465,7 +1465,7 @@ xfs_link(
                goto error_return;
        }
 
-       return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       return xfs_trans_commit(tp);
 
  error_return:
        xfs_trans_cancel(tp);
@@ -1702,7 +1702,7 @@ xfs_inactive_truncate(
 
        ASSERT(ip->i_d.di_nextents == 0);
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto error_unlock;
 
@@ -1799,7 +1799,7 @@ xfs_inactive_ifree(
        if (error)
                xfs_notice(mp, "%s: xfs_bmap_finish returned error %d",
                        __func__, error);
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                xfs_notice(mp, "%s: xfs_trans_commit returned error %d",
                        __func__, error);
@@ -2569,7 +2569,7 @@ xfs_remove(
        if (error)
                goto out_bmap_cancel;
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto std_return;
 
@@ -2659,7 +2659,7 @@ xfs_finish_rename(
                return error;
        }
 
-       return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       return xfs_trans_commit(tp);
 }
 
 /*
index 3abd3c45b019511727571ec06ac5415ddfdb4d60..ea7d85af53101f25ed0d1b9598edae5c8af77bcc 100644 (file)
@@ -346,7 +346,7 @@ xfs_set_dmattrs(
        ip->i_d.di_dmstate  = state;
 
        xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 
        return error;
 }
@@ -1253,7 +1253,7 @@ xfs_ioctl_setattr(
        else
                ip->i_d.di_extsize = 0;
 
-       code = xfs_trans_commit(tp, 0);
+       code = xfs_trans_commit(tp);
 
        /*
         * Release any dquot(s) the inode had kept before chown.
@@ -1342,7 +1342,7 @@ xfs_ioc_setxflags(
                goto out_drop_write;
        }
 
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 out_drop_write:
        mnt_drop_write_file(filp);
        return error;
index 6ca842abae10b5443eaee30ab327f0c467a5edd9..1f86033171c84ef4b12a201e112c9c37c7c69bdf 100644 (file)
@@ -213,7 +213,7 @@ xfs_iomap_write_direct(
        error = xfs_bmap_finish(&tp, &free_list, &committed);
        if (error)
                goto out_bmap_cancel;
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out_unlock;
 
@@ -760,7 +760,7 @@ xfs_iomap_write_allocate(
                        if (error)
                                goto trans_cancel;
 
-                       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+                       error = xfs_trans_commit(tp);
                        if (error)
                                goto error0;
 
@@ -890,7 +890,7 @@ xfs_iomap_write_unwritten(
                if (error)
                        goto error_on_bmapi_transaction;
 
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
                if (error)
                        return error;
index 8bd71f17f8b4c2ce1ab38d8585a308bb210f6fa2..e440aed89c826b2d1dba2c7d05b14fdaf7586427 100644 (file)
@@ -702,7 +702,7 @@ xfs_setattr_nonsize(
 
        if (mp->m_flags & XFS_MOUNT_WSYNC)
                xfs_trans_set_sync(tp);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
@@ -926,7 +926,7 @@ xfs_setattr_size(
        if (mp->m_flags & XFS_MOUNT_WSYNC)
                xfs_trans_set_sync(tp);
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
 out_unlock:
        if (lock_flags)
                xfs_iunlock(ip, lock_flags);
@@ -1002,7 +1002,7 @@ xfs_vn_update_time(
        }
        xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
        xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP);
-       return xfs_trans_commit(tp, 0);
+       return xfs_trans_commit(tp);
 }
 
 #define XFS_FIEMAP_FLAGS       (FIEMAP_FLAG_SYNC|FIEMAP_FLAG_XATTR)
index 84e0deb95abda6181b5a10b2a3f790df9c6f04ff..4040c477892f3fc2851ef46c3ab845a995fef3b1 100644 (file)
@@ -183,7 +183,7 @@ struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket);
 void     xfs_log_ticket_put(struct xlog_ticket *ticket);
 
 void   xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
-                               xfs_lsn_t *commit_lsn, int flags);
+                               xfs_lsn_t *commit_lsn, bool regrant);
 bool   xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
 
 void   xfs_log_work_queue(struct xfs_mount *mp);
index 7e0e63eb4802a90350510f265e22c646aa1fd213..d6f26d7d0ce53e7e7ae1b61caa488b36a141788e 100644 (file)
@@ -773,13 +773,13 @@ xfs_log_commit_cil(
        struct xfs_mount        *mp,
        struct xfs_trans        *tp,
        xfs_lsn_t               *commit_lsn,
-       int                     flags)
+       bool                    regrant)
 {
        struct xlog             *log = mp->m_log;
        struct xfs_cil          *cil = log->l_cilp;
        int                     log_flags = 0;
 
-       if (flags & XFS_TRANS_RELEASE_LOG_RES)
+       if (!regrant)
                log_flags = XFS_LOG_REL_PERM_RESERV;
 
        /* lock out background commit */
index 8f2923fab17b16fc06710498639f40db2ea426d8..599de7248e215e92f68dcd328bd1d39b4f428893 100644 (file)
@@ -3751,7 +3751,7 @@ xlog_recover_process_efi(
        }
 
        set_bit(XFS_EFI_RECOVERED, &efip->efi_flags);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
        return error;
 
 abort_error:
@@ -3857,7 +3857,7 @@ xlog_recover_clear_agi_bucket(
        xfs_trans_log_buf(tp, agibp, offset,
                          (offset + sizeof(xfs_agino_t) - 1));
 
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out_error;
        return;
index 3bb6097c7dd38302145191f1176fed1b93711778..ab4a6066f7ca7b24fbe4cdf2db0f2c1ddfdab3df 100644 (file)
@@ -321,7 +321,7 @@ xfs_fs_commit_blocks(
        }
 
        xfs_trans_set_sync(tp);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 
 out_drop_iolock:
        xfs_iunlock(ip, XFS_IOLOCK_EXCL);
index c4ba36dfb49cc7c8b1e19482cf305469ad60b695..eac9549efd52c824d7e298b494a470f43923936e 100644 (file)
@@ -795,7 +795,7 @@ xfs_qm_qino_alloc(
        spin_unlock(&mp->m_sb_lock);
        xfs_log_sb(tp);
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error) {
                ASSERT(XFS_FORCED_SHUTDOWN(mp));
                xfs_alert(mp, "%s failed (error %d)!", __func__, error);
index 92ad24f9e5be31e5bf4ee84ceb4321479b7e1dd2..3640c6e896af70eb2e910a31786cb7ac2298f847 100644 (file)
@@ -259,7 +259,7 @@ xfs_qm_scall_trunc_qfile(
        ASSERT(ip->i_d.di_nextents == 0);
 
        xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
 
 out_unlock:
        xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
@@ -547,7 +547,7 @@ xfs_qm_scall_setqlim(
        dqp->dq_flags |= XFS_DQ_DIRTY;
        xfs_trans_log_dquot(tp, dqp);
 
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
 
 out_rele:
        xfs_qm_dqrele(dqp);
@@ -584,8 +584,7 @@ xfs_qm_log_quotaoff_end(
         * We don't care about quotoff's performance.
         */
        xfs_trans_set_sync(tp);
-       error = xfs_trans_commit(tp, 0);
-       return error;
+       return xfs_trans_commit(tp);
 }
 
 
@@ -623,7 +622,7 @@ xfs_qm_log_quotaoff(
         * We don't care about quotoff's performance.
         */
        xfs_trans_set_sync(tp);
-       error = xfs_trans_commit(tp, 0);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out;
 
index ff5af6693650c8a241e548053b128007e0edc708..f4e8c06eee26d0e5e4608bc40f3c571b3618d433 100644 (file)
@@ -815,7 +815,7 @@ xfs_growfs_rt_alloc(
                error = xfs_bmap_finish(&tp, &flist, &committed);
                if (error)
                        goto error_cancel;
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+               error = xfs_trans_commit(tp);
                if (error)
                        goto error;
                /*
@@ -855,7 +855,7 @@ error_cancel:
                        /*
                         * Commit the transaction.
                         */
-                       error = xfs_trans_commit(tp, 0);
+                       error = xfs_trans_commit(tp);
                        if (error)
                                goto error;
                }
@@ -1070,7 +1070,7 @@ error_cancel:
                mp->m_rsumlevels = nrsumlevels;
                mp->m_rsumsize = nrsumsize;
 
-               error = xfs_trans_commit(tp, 0);
+               error = xfs_trans_commit(tp);
                if (error)
                        break;
        }
index b5573bf45ca17ce6dbfdf95b5c9fcffde3cf25f9..2d90452062b0d74a79bc7c31f06ba07eb96c2755 100644 (file)
@@ -390,7 +390,7 @@ xfs_symlink(
        if (error)
                goto out_bmap_cancel;
 
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error)
                goto out_release_inode;
 
@@ -528,7 +528,7 @@ xfs_inactive_symlink_rmt(
        /*
         * Commit the transaction containing extent freeing and EFDs.
         */
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        if (error) {
                ASSERT(XFS_FORCED_SHUTDOWN(mp));
                goto error_unlock;
index 6cca99640d1a9b18934b7064f12db9e496156f38..fb1bd17ea8ceca6ed5b18cc54ac7f7051fd1d218 100644 (file)
@@ -892,26 +892,16 @@ xfs_trans_committed_bulk(
  * have already been unlocked as if the commit had succeeded.
  * Do not reference the transaction structure after this call.
  */
-int
-xfs_trans_commit(
+static int
+__xfs_trans_commit(
        struct xfs_trans        *tp,
-       uint                    flags)
+       bool                    regrant)
 {
        struct xfs_mount        *mp = tp->t_mountp;
        xfs_lsn_t               commit_lsn = -1;
        int                     error = 0;
-       int                     log_flags = 0;
        int                     sync = tp->t_flags & XFS_TRANS_SYNC;
 
-       /*
-        * Determine whether this commit is releasing a permanent
-        * log reservation or not.
-        */
-       if (flags & XFS_TRANS_RELEASE_LOG_RES) {
-               ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
-               log_flags = XFS_LOG_REL_PERM_RESERV;
-       }
-
        /*
         * If there is nothing to be logged by the transaction,
         * then unlock all of the items associated with the
@@ -936,7 +926,7 @@ xfs_trans_commit(
                xfs_trans_apply_sb_deltas(tp);
        xfs_trans_apply_dquot_deltas(tp);
 
-       xfs_log_commit_cil(mp, tp, &commit_lsn, flags);
+       xfs_log_commit_cil(mp, tp, &commit_lsn, regrant);
 
        current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
        xfs_trans_free(tp);
@@ -964,6 +954,12 @@ out_unreserve:
         */
        xfs_trans_unreserve_and_mod_dquots(tp);
        if (tp->t_ticket) {
+               int                     log_flags = 0;
+
+               if (regrant)
+                       ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
+               else
+                       log_flags = XFS_LOG_REL_PERM_RESERV;
                commit_lsn = xfs_log_done(mp, tp->t_ticket, NULL, log_flags);
                if (commit_lsn == -1 && !error)
                        error = -EIO;
@@ -976,6 +972,13 @@ out_unreserve:
        return error;
 }
 
+int
+xfs_trans_commit(
+       struct xfs_trans        *tp)
+{
+       return __xfs_trans_commit(tp, false);
+}
+
 /*
  * Unlock all of the transaction's items and free the transaction.
  * The transaction must not have modified any of its items, because
@@ -1029,7 +1032,7 @@ xfs_trans_cancel(
 /*
  * Roll from one trans in the sequence of PERMANENT transactions to
  * the next: permanent transactions are only flushed out when
- * committed with XFS_TRANS_RELEASE_LOG_RES, but we still want as soon
+ * committed with xfs_trans_commit(), but we still want as soon
  * as possible to let chunks of it go to the log. So we commit the
  * chunk we've been working on and get a new transaction to continue.
  */
@@ -1063,7 +1066,7 @@ xfs_trans_roll(
         * is in progress. The caller takes the responsibility to cancel
         * the duplicate transaction that gets returned.
         */
-       error = xfs_trans_commit(trans, 0);
+       error = __xfs_trans_commit(trans, true);
        if (error)
                return error;
 
index ca95b92a40a521847bbdc50f0c650a875b818e4a..3b21b4e5e4678885f0a9197cd073684814a118a4 100644 (file)
@@ -225,7 +225,7 @@ void                xfs_trans_log_efd_extent(xfs_trans_t *,
                                         struct xfs_efd_log_item *,
                                         xfs_fsblock_t,
                                         xfs_extlen_t);
-int            xfs_trans_commit(xfs_trans_t *, uint flags);
+int            xfs_trans_commit(struct xfs_trans *);
 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 *);