Commit 8ad7c629 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: remove the ip argument to xfs_defer_finish

And instead require callers to explicitly join the inode using
xfs_defer_ijoin.  Also consolidate the defer error handling in
a few places using a goto label.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 882d8785
...@@ -328,13 +328,12 @@ xfs_attr_set( ...@@ -328,13 +328,12 @@ xfs_attr_set(
*/ */
xfs_defer_init(args.dfops, args.firstblock); xfs_defer_init(args.dfops, args.firstblock);
error = xfs_attr_shortform_to_leaf(&args); error = xfs_attr_shortform_to_leaf(&args);
if (!error) if (error)
error = xfs_defer_finish(&args.trans, args.dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args.dfops, dp);
args.trans = NULL; error = xfs_defer_finish(&args.trans, args.dfops);
xfs_defer_cancel(&dfops); if (error)
goto out; goto out_defer_cancel;
}
/* /*
* Commit the leaf transformation. We'll need another (linked) * Commit the leaf transformation. We'll need another (linked)
...@@ -373,6 +372,9 @@ xfs_attr_set( ...@@ -373,6 +372,9 @@ xfs_attr_set(
return error; return error;
out_defer_cancel:
xfs_defer_cancel(&dfops);
args.trans = NULL;
out: out:
if (args.trans) if (args.trans)
xfs_trans_cancel(args.trans); xfs_trans_cancel(args.trans);
...@@ -593,13 +595,12 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) ...@@ -593,13 +595,12 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
*/ */
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_node(args); error = xfs_attr3_leaf_to_node(args);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args->dfops, dp);
args->trans = NULL; error = xfs_defer_finish(&args->trans, args->dfops);
xfs_defer_cancel(args->dfops); if (error)
return error; goto out_defer_cancel;
}
/* /*
* Commit the current trans (including the inode) and start * Commit the current trans (including the inode) and start
...@@ -684,14 +685,12 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) ...@@ -684,14 +685,12 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */ /* bp is gone due to xfs_da_shrink_inode */
if (!error) if (error)
error = xfs_defer_finish(&args->trans, goto out_defer_cancel;
args->dfops, dp); xfs_defer_ijoin(args->dfops, dp);
if (error) { error = xfs_defer_finish(&args->trans, args->dfops);
args->trans = NULL; if (error)
xfs_defer_cancel(args->dfops); goto out_defer_cancel;
return error;
}
} }
/* /*
...@@ -706,6 +705,10 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) ...@@ -706,6 +705,10 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
error = xfs_attr3_leaf_clearflag(args); error = xfs_attr3_leaf_clearflag(args);
} }
return error; return error;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
} }
/* /*
...@@ -747,15 +750,18 @@ xfs_attr_leaf_removename(xfs_da_args_t *args) ...@@ -747,15 +750,18 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */ /* bp is gone due to xfs_da_shrink_inode */
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args->dfops, dp);
args->trans = NULL; error = xfs_defer_finish(&args->trans, args->dfops);
xfs_defer_cancel(args->dfops); if (error)
return error; goto out_defer_cancel;
}
} }
return 0; return 0;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
} }
/* /*
...@@ -872,14 +878,12 @@ xfs_attr_node_addname(xfs_da_args_t *args) ...@@ -872,14 +878,12 @@ xfs_attr_node_addname(xfs_da_args_t *args)
state = NULL; state = NULL;
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_node(args); error = xfs_attr3_leaf_to_node(args);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, goto out_defer_cancel;
args->dfops, dp); xfs_defer_ijoin(args->dfops, dp);
if (error) { error = xfs_defer_finish(&args->trans, args->dfops);
args->trans = NULL; if (error)
xfs_defer_cancel(args->dfops); goto out_defer_cancel;
goto out;
}
/* /*
* Commit the node conversion and start the next * Commit the node conversion and start the next
...@@ -900,13 +904,12 @@ xfs_attr_node_addname(xfs_da_args_t *args) ...@@ -900,13 +904,12 @@ xfs_attr_node_addname(xfs_da_args_t *args)
*/ */
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_split(state); error = xfs_da3_split(state);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args->dfops, dp);
args->trans = NULL; error = xfs_defer_finish(&args->trans, args->dfops);
xfs_defer_cancel(args->dfops); if (error)
goto out; goto out_defer_cancel;
}
} else { } else {
/* /*
* Addition succeeded, update Btree hashvals. * Addition succeeded, update Btree hashvals.
...@@ -999,14 +1002,12 @@ xfs_attr_node_addname(xfs_da_args_t *args) ...@@ -999,14 +1002,12 @@ xfs_attr_node_addname(xfs_da_args_t *args)
if (retval && (state->path.active > 1)) { if (retval && (state->path.active > 1)) {
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_join(state); error = xfs_da3_join(state);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, goto out_defer_cancel;
args->dfops, dp); xfs_defer_ijoin(args->dfops, dp);
if (error) { error = xfs_defer_finish(&args->trans, args->dfops);
args->trans = NULL; if (error)
xfs_defer_cancel(args->dfops); goto out_defer_cancel;
goto out;
}
} }
/* /*
...@@ -1032,6 +1033,10 @@ xfs_attr_node_addname(xfs_da_args_t *args) ...@@ -1032,6 +1033,10 @@ xfs_attr_node_addname(xfs_da_args_t *args)
if (error) if (error)
return error; return error;
return retval; return retval;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
goto out;
} }
/* /*
...@@ -1122,13 +1127,12 @@ xfs_attr_node_removename(xfs_da_args_t *args) ...@@ -1122,13 +1127,12 @@ xfs_attr_node_removename(xfs_da_args_t *args)
if (retval && (state->path.active > 1)) { if (retval && (state->path.active > 1)) {
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_join(state); error = xfs_da3_join(state);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args->dfops, dp);
args->trans = NULL; error = xfs_defer_finish(&args->trans, args->dfops);
xfs_defer_cancel(args->dfops); if (error)
goto out; goto out_defer_cancel;
}
/* /*
* Commit the Btree join operation and start a new trans. * Commit the Btree join operation and start a new trans.
*/ */
...@@ -1156,14 +1160,12 @@ xfs_attr_node_removename(xfs_da_args_t *args) ...@@ -1156,14 +1160,12 @@ xfs_attr_node_removename(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock); xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */ /* bp is gone due to xfs_da_shrink_inode */
if (!error) if (error)
error = xfs_defer_finish(&args->trans, goto out_defer_cancel;
args->dfops, dp); xfs_defer_ijoin(args->dfops, dp);
if (error) { error = xfs_defer_finish(&args->trans, args->dfops);
args->trans = NULL; if (error)
xfs_defer_cancel(args->dfops); goto out_defer_cancel;
goto out;
}
} else } else
xfs_trans_brelse(args->trans, bp); xfs_trans_brelse(args->trans, bp);
} }
...@@ -1172,6 +1174,10 @@ xfs_attr_node_removename(xfs_da_args_t *args) ...@@ -1172,6 +1174,10 @@ xfs_attr_node_removename(xfs_da_args_t *args)
out: out:
xfs_da_state_free(state); xfs_da_state_free(state);
return error; return error;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
goto out;
} }
/* /*
......
...@@ -467,13 +467,12 @@ xfs_attr_rmtval_set( ...@@ -467,13 +467,12 @@ xfs_attr_rmtval_set(
error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock, blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
args->total, &map, &nmap, args->dfops); args->total, &map, &nmap, args->dfops);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, dp); goto out_defer_cancel;
if (error) { xfs_defer_ijoin(args->dfops, dp);
args->trans = NULL; error = xfs_defer_finish(&args->trans, args->dfops);
xfs_defer_cancel(args->dfops); if (error)
return error; goto out_defer_cancel;
}
ASSERT(nmap == 1); ASSERT(nmap == 1);
ASSERT((map.br_startblock != DELAYSTARTBLOCK) && ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
...@@ -539,6 +538,10 @@ xfs_attr_rmtval_set( ...@@ -539,6 +538,10 @@ xfs_attr_rmtval_set(
} }
ASSERT(valuelen == 0); ASSERT(valuelen == 0);
return 0; return 0;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
} }
/* /*
...@@ -609,14 +612,12 @@ xfs_attr_rmtval_remove( ...@@ -609,14 +612,12 @@ xfs_attr_rmtval_remove(
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
XFS_BMAPI_ATTRFORK, 1, args->firstblock, XFS_BMAPI_ATTRFORK, 1, args->firstblock,
args->dfops, &done); args->dfops, &done);
if (!error) if (error)
error = xfs_defer_finish(&args->trans, args->dfops, goto out_defer_cancel;
args->dp); xfs_defer_ijoin(args->dfops, args->dp);
if (error) { error = xfs_defer_finish(&args->trans, args->dfops);
args->trans = NULL; if (error)
xfs_defer_cancel(args->dfops); goto out_defer_cancel;
return error;
}
/* /*
* Close out trans and start the next one in the chain. * Close out trans and start the next one in the chain.
...@@ -626,4 +627,8 @@ xfs_attr_rmtval_remove( ...@@ -626,4 +627,8 @@ xfs_attr_rmtval_remove(
return error; return error;
} }
return 0; return 0;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
} }
...@@ -1196,7 +1196,7 @@ xfs_bmap_add_attrfork( ...@@ -1196,7 +1196,7 @@ xfs_bmap_add_attrfork(
xfs_log_sb(tp); xfs_log_sb(tp);
} }
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto bmap_cancel; goto bmap_cancel;
error = xfs_trans_commit(tp); error = xfs_trans_commit(tp);
...@@ -6402,7 +6402,7 @@ xfs_bmap_split_extent( ...@@ -6402,7 +6402,7 @@ xfs_bmap_split_extent(
if (error) if (error)
goto out; goto out;
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out; goto out;
......
...@@ -277,8 +277,7 @@ xfs_defer_has_unfinished_work( ...@@ -277,8 +277,7 @@ xfs_defer_has_unfinished_work(
/* /*
* Add this inode to the deferred op. Each joined inode is relogged * Add this inode to the deferred op. Each joined inode is relogged
* each time we roll the transaction, in addition to any inode passed * each time we roll the transaction.
* to xfs_defer_finish().
*/ */
int int
xfs_defer_ijoin( xfs_defer_ijoin(
...@@ -310,8 +309,7 @@ xfs_defer_ijoin( ...@@ -310,8 +309,7 @@ xfs_defer_ijoin(
int int
xfs_defer_finish( xfs_defer_finish(
struct xfs_trans **tp, struct xfs_trans **tp,
struct xfs_defer_ops *dop, struct xfs_defer_ops *dop)
struct xfs_inode *ip)
{ {
struct xfs_defer_pending *dfp; struct xfs_defer_pending *dfp;
struct list_head *li; struct list_head *li;
...@@ -324,8 +322,6 @@ xfs_defer_finish( ...@@ -324,8 +322,6 @@ xfs_defer_finish(
trace_xfs_defer_finish((*tp)->t_mountp, dop); trace_xfs_defer_finish((*tp)->t_mountp, dop);
xfs_defer_ijoin(dop, ip);
/* Until we run out of pending work to finish... */ /* Until we run out of pending work to finish... */
while (xfs_defer_has_unfinished_work(dop)) { while (xfs_defer_has_unfinished_work(dop)) {
/* Log intents for work items sitting in the intake. */ /* Log intents for work items sitting in the intake. */
......
...@@ -72,8 +72,7 @@ struct xfs_defer_ops { ...@@ -72,8 +72,7 @@ struct xfs_defer_ops {
void xfs_defer_add(struct xfs_defer_ops *dop, enum xfs_defer_ops_type type, void xfs_defer_add(struct xfs_defer_ops *dop, enum xfs_defer_ops_type type,
struct list_head *h); struct list_head *h);
int xfs_defer_finish(struct xfs_trans **tp, struct xfs_defer_ops *dop, int xfs_defer_finish(struct xfs_trans **tp, struct xfs_defer_ops *dop);
struct xfs_inode *ip);
void xfs_defer_cancel(struct xfs_defer_ops *dop); void xfs_defer_cancel(struct xfs_defer_ops *dop);
void xfs_defer_init(struct xfs_defer_ops *dop, xfs_fsblock_t *fbp); void xfs_defer_init(struct xfs_defer_ops *dop, xfs_fsblock_t *fbp);
bool xfs_defer_has_unfinished_work(struct xfs_defer_ops *dop); bool xfs_defer_has_unfinished_work(struct xfs_defer_ops *dop);
......
...@@ -1679,7 +1679,7 @@ xfs_refcount_recover_cow_leftovers( ...@@ -1679,7 +1679,7 @@ xfs_refcount_recover_cow_leftovers(
xfs_bmap_add_free(mp, &dfops, fsb, xfs_bmap_add_free(mp, &dfops, fsb,
rr->rr_rrec.rc_blockcount, NULL); rr->rr_rrec.rc_blockcount, NULL);
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_defer; goto out_defer;
......
...@@ -502,7 +502,7 @@ xfs_bui_recover( ...@@ -502,7 +502,7 @@ xfs_bui_recover(
} }
/* Finish transaction, free inodes. */ /* Finish transaction, free inodes. */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto err_dfops; goto err_dfops;
......
...@@ -1136,7 +1136,7 @@ xfs_alloc_file_space( ...@@ -1136,7 +1136,7 @@ xfs_alloc_file_space(
/* /*
* Complete the transaction * Complete the transaction
*/ */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto error0; goto error0;
...@@ -1202,7 +1202,8 @@ xfs_unmap_extent( ...@@ -1202,7 +1202,8 @@ xfs_unmap_extent(
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
error = xfs_defer_finish(&tp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -1496,7 +1497,7 @@ xfs_shift_file_space( ...@@ -1496,7 +1497,7 @@ xfs_shift_file_space(
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -1777,7 +1778,8 @@ xfs_swap_extent_rmap( ...@@ -1777,7 +1778,8 @@ xfs_swap_extent_rmap(
if (error) if (error)
goto out_defer; goto out_defer;
error = xfs_defer_finish(tpp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(tpp, &dfops);
if (error) if (error)
goto out_defer; goto out_defer;
......
...@@ -383,7 +383,7 @@ xfs_qm_dqalloc( ...@@ -383,7 +383,7 @@ xfs_qm_dqalloc(
xfs_trans_bhold(tp, bp); xfs_trans_bhold(tp, bp);
error = xfs_defer_finish(tpp, &dfops, NULL); error = xfs_defer_finish(tpp, &dfops);
if (error) if (error)
goto error1; goto error1;
......
...@@ -1285,7 +1285,7 @@ xfs_create( ...@@ -1285,7 +1285,7 @@ xfs_create(
*/ */
xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -1513,7 +1513,7 @@ xfs_link( ...@@ -1513,7 +1513,7 @@ xfs_link(
if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
xfs_trans_set_sync(tp); xfs_trans_set_sync(tp);
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) { if (error) {
xfs_defer_cancel(&dfops); xfs_defer_cancel(&dfops);
goto error_return; goto error_return;
...@@ -1607,7 +1607,8 @@ xfs_itruncate_extents( ...@@ -1607,7 +1607,8 @@ xfs_itruncate_extents(
* Duplicate the transaction that has the permanent * Duplicate the transaction that has the permanent
* reservation and commit the old transaction. * reservation and commit the old transaction.
*/ */
error = xfs_defer_finish(&tp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -1855,7 +1856,7 @@ xfs_inactive_ifree( ...@@ -1855,7 +1856,7 @@ xfs_inactive_ifree(
* Just ignore errors at this point. There is nothing we can do except * Just ignore errors at this point. There is nothing we can do except
* to try to keep going. Make sure it's not a silent error. * to try to keep going. Make sure it's not a silent error.
*/ */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) { if (error) {
xfs_notice(mp, "%s: xfs_defer_finish returned error %d", xfs_notice(mp, "%s: xfs_defer_finish returned error %d",
__func__, error); __func__, error);
...@@ -2650,7 +2651,7 @@ xfs_remove( ...@@ -2650,7 +2651,7 @@ xfs_remove(
if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
xfs_trans_set_sync(tp); xfs_trans_set_sync(tp);
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -2736,7 +2737,7 @@ xfs_finish_rename( ...@@ -2736,7 +2737,7 @@ xfs_finish_rename(
if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
xfs_trans_set_sync(tp); xfs_trans_set_sync(tp);
error = xfs_defer_finish(&tp, dfops, NULL); error = xfs_defer_finish(&tp, dfops);
if (error) { if (error) {
xfs_defer_cancel(dfops); xfs_defer_cancel(dfops);
xfs_trans_cancel(tp); xfs_trans_cancel(tp);
......
...@@ -274,7 +274,7 @@ xfs_iomap_write_direct( ...@@ -274,7 +274,7 @@ xfs_iomap_write_direct(
/* /*
* Complete the transaction * Complete the transaction
*/ */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -784,7 +784,7 @@ xfs_iomap_write_allocate( ...@@ -784,7 +784,7 @@ xfs_iomap_write_allocate(
if (error) if (error)
goto trans_cancel; goto trans_cancel;
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto trans_cancel; goto trans_cancel;
...@@ -906,7 +906,7 @@ xfs_iomap_write_unwritten( ...@@ -906,7 +906,7 @@ xfs_iomap_write_unwritten(
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
} }
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto error_on_bmapi_transaction; goto error_on_bmapi_transaction;
......
...@@ -525,7 +525,7 @@ xfs_cui_recover( ...@@ -525,7 +525,7 @@ xfs_cui_recover(
} }
xfs_refcount_finish_one_cleanup(tp, rcur, error); xfs_refcount_finish_one_cleanup(tp, rcur, error);
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto abort_defer; goto abort_defer;
set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags); set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags);
......
...@@ -464,7 +464,7 @@ xfs_reflink_allocate_cow( ...@@ -464,7 +464,7 @@ xfs_reflink_allocate_cow(
goto out_bmap_cancel; goto out_bmap_cancel;
/* Finish up. */ /* Finish up. */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -602,7 +602,8 @@ xfs_reflink_cancel_cow_blocks( ...@@ -602,7 +602,8 @@ xfs_reflink_cancel_cow_blocks(
-(long)del.br_blockcount); -(long)del.br_blockcount);
/* Roll the transaction */ /* Roll the transaction */
error = xfs_defer_finish(tpp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(tpp, &dfops);
if (error) { if (error) {
xfs_defer_cancel(&dfops); xfs_defer_cancel(&dfops);
break; break;
...@@ -791,7 +792,8 @@ xfs_reflink_end_cow( ...@@ -791,7 +792,8 @@ xfs_reflink_end_cow(
/* Remove the mapping from the CoW fork. */ /* Remove the mapping from the CoW fork. */
xfs_bmap_del_extent_cow(ip, &idx, &got, &del); xfs_bmap_del_extent_cow(ip, &idx, &got, &del);
error = xfs_defer_finish(&tp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_defer; goto out_defer;
next_extent: next_extent:
...@@ -1152,7 +1154,8 @@ xfs_reflink_remap_extent( ...@@ -1152,7 +1154,8 @@ xfs_reflink_remap_extent(
next_extent: next_extent:
/* Process all the deferred stuff. */ /* Process all the deferred stuff. */
error = xfs_defer_finish(&tp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_defer; goto out_defer;
} }
......
...@@ -810,7 +810,7 @@ xfs_growfs_rt_alloc( ...@@ -810,7 +810,7 @@ xfs_growfs_rt_alloc(
/* /*
* Free any blocks freed up in the transaction, then commit. * Free any blocks freed up in the transaction, then commit.
*/ */
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
error = xfs_trans_commit(tp); error = xfs_trans_commit(tp);
......
...@@ -378,7 +378,7 @@ xfs_symlink( ...@@ -378,7 +378,7 @@ xfs_symlink(
xfs_trans_set_sync(tp); xfs_trans_set_sync(tp);
} }
error = xfs_defer_finish(&tp, &dfops, NULL); error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto out_bmap_cancel; goto out_bmap_cancel;
...@@ -497,7 +497,8 @@ xfs_inactive_symlink_rmt( ...@@ -497,7 +497,8 @@ xfs_inactive_symlink_rmt(
/* /*
* Commit the first transaction. This logs the EFI and the inode. * Commit the first transaction. This logs the EFI and the inode.
*/ */
error = xfs_defer_finish(&tp, &dfops, ip); xfs_defer_ijoin(&dfops, ip);
error = xfs_defer_finish(&tp, &dfops);
if (error) if (error)
goto error_bmap_cancel; goto error_bmap_cancel;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment