summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_refcount_item.c
diff options
context:
space:
mode:
authorBrian Foster2018-08-01 16:20:29 +0200
committerDarrick J. Wong2018-08-03 08:05:13 +0200
commitfbfa977d25dc8db92dbf5fcafb0e03fae0005be5 (patch)
tree44780c8d267753558a12cefef8b4e8c4838ab4a6 /fs/xfs/xfs_refcount_item.c
parentxfs: refactor internal dfops initialization (diff)
downloadkernel-qcow2-linux-fbfa977d25dc8db92dbf5fcafb0e03fae0005be5.tar.gz
kernel-qcow2-linux-fbfa977d25dc8db92dbf5fcafb0e03fae0005be5.tar.xz
kernel-qcow2-linux-fbfa977d25dc8db92dbf5fcafb0e03fae0005be5.zip
xfs: use transaction for intent recovery instead of raw dfops
Log intent recovery is the last user of an external (on-stack) dfops. The pattern exists because the dfops is used to collect additional deferred operations queued during the whole recovery sequence. The dfops is finished with a new transaction after intent recovery completes. We already have a mechanism to create an empty, container-like transaction to support the scrub infrastructure. We can reuse that mechanism here to drop the final user of external dfops. This facilitates folding dfops state (i.e., dop_low) into the transaction, the elimination of now unused external dfops support and also eliminates the only caller of __xfs_defer_cancel(). Replace the on-stack dfops with an empty transaction and pass it around to the various helpers that queue and finish deferred operations during intent recovery. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_refcount_item.c')
-rw-r--r--fs/xfs/xfs_refcount_item.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index d3582a06626f..011e1d0640fb 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -380,9 +380,8 @@ xfs_cud_init(
*/
int
xfs_cui_recover(
- struct xfs_mount *mp,
- struct xfs_cui_log_item *cuip,
- struct xfs_defer_ops *dfops)
+ struct xfs_trans *parent_tp,
+ struct xfs_cui_log_item *cuip)
{
int i;
int error = 0;
@@ -398,6 +397,7 @@ xfs_cui_recover(
xfs_extlen_t new_len;
struct xfs_bmbt_irec irec;
bool requeue_only = false;
+ struct xfs_mount *mp = parent_tp->t_mountp;
ASSERT(!test_bit(XFS_CUI_RECOVERED, &cuip->cui_flags));
@@ -457,7 +457,7 @@ xfs_cui_recover(
* finishes them on completion. Transfer current dfops state to this
* transaction and transfer the result back before we return.
*/
- xfs_defer_move(tp->t_dfops, dfops);
+ xfs_defer_move(tp->t_dfops, parent_tp->t_dfops);
cudp = xfs_trans_get_cud(tp, cuip);
for (i = 0; i < cuip->cui_format.cui_nextents; i++) {
@@ -522,13 +522,13 @@ xfs_cui_recover(
xfs_refcount_finish_one_cleanup(tp, rcur, error);
set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags);
- xfs_defer_move(dfops, tp->t_dfops);
+ xfs_defer_move(parent_tp->t_dfops, tp->t_dfops);
error = xfs_trans_commit(tp);
return error;
abort_error:
xfs_refcount_finish_one_cleanup(tp, rcur, error);
- xfs_defer_move(dfops, tp->t_dfops);
+ xfs_defer_move(parent_tp->t_dfops, tp->t_dfops);
xfs_trans_cancel(tp);
return error;
}