|
@@ -905,7 +905,6 @@ xfs_dir_ialloc(
|
|
|
|
|
|
{
|
|
|
xfs_trans_t *tp;
|
|
|
- xfs_trans_t *ntp;
|
|
|
xfs_inode_t *ip;
|
|
|
xfs_buf_t *ialloc_context = NULL;
|
|
|
int code;
|
|
@@ -954,8 +953,6 @@ xfs_dir_ialloc(
|
|
|
* to succeed the second time.
|
|
|
*/
|
|
|
if (ialloc_context) {
|
|
|
- struct xfs_trans_res tres;
|
|
|
-
|
|
|
/*
|
|
|
* Normally, xfs_trans_commit releases all the locks.
|
|
|
* We call bhold to hang on to the ialloc_context across
|
|
@@ -964,12 +961,6 @@ xfs_dir_ialloc(
|
|
|
* allocation group.
|
|
|
*/
|
|
|
xfs_trans_bhold(tp, ialloc_context);
|
|
|
- /*
|
|
|
- * Save the log reservation so we can use
|
|
|
- * them in the next transaction.
|
|
|
- */
|
|
|
- tres.tr_logres = xfs_trans_get_log_res(tp);
|
|
|
- tres.tr_logcount = xfs_trans_get_log_count(tp);
|
|
|
|
|
|
/*
|
|
|
* We want the quota changes to be associated with the next
|
|
@@ -985,35 +976,9 @@ xfs_dir_ialloc(
|
|
|
tp->t_flags &= ~(XFS_TRANS_DQ_DIRTY);
|
|
|
}
|
|
|
|
|
|
- ntp = xfs_trans_dup(tp);
|
|
|
- code = xfs_trans_commit(tp, 0);
|
|
|
- tp = ntp;
|
|
|
- if (committed != NULL) {
|
|
|
+ code = xfs_trans_roll(&tp, 0);
|
|
|
+ if (committed != NULL)
|
|
|
*committed = 1;
|
|
|
- }
|
|
|
- /*
|
|
|
- * If we get an error during the commit processing,
|
|
|
- * release the buffer that is still held and return
|
|
|
- * to the caller.
|
|
|
- */
|
|
|
- if (code) {
|
|
|
- xfs_buf_relse(ialloc_context);
|
|
|
- if (dqinfo) {
|
|
|
- tp->t_dqinfo = dqinfo;
|
|
|
- xfs_trans_free_dqinfo(tp);
|
|
|
- }
|
|
|
- *tpp = ntp;
|
|
|
- *ipp = NULL;
|
|
|
- return code;
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * transaction commit worked ok so we can drop the extra ticket
|
|
|
- * reference that we gained in xfs_trans_dup()
|
|
|
- */
|
|
|
- xfs_log_ticket_put(tp->t_ticket);
|
|
|
- tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
|
|
|
- code = xfs_trans_reserve(tp, &tres, 0, 0);
|
|
|
|
|
|
/*
|
|
|
* Re-attach the quota info that we detached from prev trx.
|
|
@@ -1025,7 +990,7 @@ xfs_dir_ialloc(
|
|
|
|
|
|
if (code) {
|
|
|
xfs_buf_relse(ialloc_context);
|
|
|
- *tpp = ntp;
|
|
|
+ *tpp = tp;
|
|
|
*ipp = NULL;
|
|
|
return code;
|
|
|
}
|
|
@@ -1555,7 +1520,6 @@ xfs_itruncate_extents(
|
|
|
{
|
|
|
struct xfs_mount *mp = ip->i_mount;
|
|
|
struct xfs_trans *tp = *tpp;
|
|
|
- struct xfs_trans *ntp;
|
|
|
xfs_bmap_free_t free_list;
|
|
|
xfs_fsblock_t first_block;
|
|
|
xfs_fileoff_t first_unmap_block;
|
|
@@ -1613,29 +1577,7 @@ xfs_itruncate_extents(
|
|
|
if (error)
|
|
|
goto out_bmap_cancel;
|
|
|
|
|
|
- if (committed) {
|
|
|
- /*
|
|
|
- * Mark the inode dirty so it will be logged and
|
|
|
- * moved forward in the log as part of every commit.
|
|
|
- */
|
|
|
- xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
|
|
- }
|
|
|
-
|
|
|
- ntp = xfs_trans_dup(tp);
|
|
|
- error = xfs_trans_commit(tp, 0);
|
|
|
- tp = ntp;
|
|
|
-
|
|
|
- xfs_trans_ijoin(tp, ip, 0);
|
|
|
-
|
|
|
- if (error)
|
|
|
- goto out;
|
|
|
-
|
|
|
- /*
|
|
|
- * Transaction commit worked ok so we can drop the extra ticket
|
|
|
- * reference that we gained in xfs_trans_dup()
|
|
|
- */
|
|
|
- xfs_log_ticket_put(tp->t_ticket);
|
|
|
- error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0);
|
|
|
+ error = xfs_trans_roll(&tp, ip);
|
|
|
if (error)
|
|
|
goto out;
|
|
|
}
|