summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-05-01 16:00:50 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-08 08:50:00 -0700
commit10d0c6e06fc87fe9e99d7c8df493f973b354fd9c (patch)
tree3aaf650a7d09c8c5c178f9305dc418c065bccfa1 /fs/xfs/xfs_log_recover.c
parent2565a11b224b68a222838d09623c6a398c4d5f6c (diff)
downloadlinux-10d0c6e06fc87fe9e99d7c8df493f973b354fd9c.tar.gz
linux-10d0c6e06fc87fe9e99d7c8df493f973b354fd9c.tar.bz2
linux-10d0c6e06fc87fe9e99d7c8df493f973b354fd9c.zip
xfs: refactor recovered EFI log item playback
Move the code that processes the log items created from the recovered log items into the per-item source code files and use dispatch functions to call them. No functional changes. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c54
1 files changed, 8 insertions, 46 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 02148e341760..055a9c0c20b0 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2546,46 +2546,6 @@ xlog_recover_process_data(
return 0;
}
-/* Recover the EFI if necessary. */
-STATIC int
-xlog_recover_process_efi(
- struct xfs_mount *mp,
- struct xfs_ail *ailp,
- struct xfs_log_item *lip)
-{
- struct xfs_efi_log_item *efip;
- int error;
-
- /*
- * Skip EFIs that we've already processed.
- */
- efip = container_of(lip, struct xfs_efi_log_item, efi_item);
- if (test_bit(XFS_EFI_RECOVERED, &efip->efi_flags))
- return 0;
-
- spin_unlock(&ailp->ail_lock);
- error = xfs_efi_recover(mp, efip);
- spin_lock(&ailp->ail_lock);
-
- return error;
-}
-
-/* Release the EFI since we're cancelling everything. */
-STATIC void
-xlog_recover_cancel_efi(
- struct xfs_mount *mp,
- struct xfs_ail *ailp,
- struct xfs_log_item *lip)
-{
- struct xfs_efi_log_item *efip;
-
- efip = container_of(lip, struct xfs_efi_log_item, efi_item);
-
- spin_unlock(&ailp->ail_lock);
- xfs_efi_release(efip);
- spin_lock(&ailp->ail_lock);
-}
-
/* Recover the RUI if necessary. */
STATIC int
xlog_recover_process_rui(
@@ -2829,9 +2789,6 @@ xlog_recover_process_intents(
* replayed in the wrong order!
*/
switch (lip->li_type) {
- case XFS_LI_EFI:
- error = xlog_recover_process_efi(log->l_mp, ailp, lip);
- break;
case XFS_LI_RUI:
error = xlog_recover_process_rui(log->l_mp, ailp, lip);
break;
@@ -2841,6 +2798,9 @@ xlog_recover_process_intents(
case XFS_LI_BUI:
error = xlog_recover_process_bui(parent_tp, ailp, lip);
break;
+ default:
+ error = lip->li_ops->iop_recover(lip, parent_tp);
+ break;
}
if (error)
goto out;
@@ -2885,9 +2845,6 @@ xlog_recover_cancel_intents(
}
switch (lip->li_type) {
- case XFS_LI_EFI:
- xlog_recover_cancel_efi(log->l_mp, ailp, lip);
- break;
case XFS_LI_RUI:
xlog_recover_cancel_rui(log->l_mp, ailp, lip);
break;
@@ -2897,6 +2854,11 @@ xlog_recover_cancel_intents(
case XFS_LI_BUI:
xlog_recover_cancel_bui(log->l_mp, ailp, lip);
break;
+ default:
+ spin_unlock(&ailp->ail_lock);
+ lip->li_ops->iop_release(lip);
+ spin_lock(&ailp->ail_lock);
+ break;
}
lip = xfs_trans_ail_cursor_next(ailp, &cur);