xfs: refactor recovered CUI 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>
This commit is contained in:
Darrick J. Wong
2020-05-01 16:00:51 -07:00
parent cba0ccac28
commit c57ed2f5a2
3 changed files with 35 additions and 58 deletions

View File

@ -2546,46 +2546,6 @@ xlog_recover_process_data(
return 0;
}
/* Recover the CUI if necessary. */
STATIC int
xlog_recover_process_cui(
struct xfs_trans *parent_tp,
struct xfs_ail *ailp,
struct xfs_log_item *lip)
{
struct xfs_cui_log_item *cuip;
int error;
/*
* Skip CUIs that we've already processed.
*/
cuip = container_of(lip, struct xfs_cui_log_item, cui_item);
if (test_bit(XFS_CUI_RECOVERED, &cuip->cui_flags))
return 0;
spin_unlock(&ailp->ail_lock);
error = xfs_cui_recover(parent_tp, cuip);
spin_lock(&ailp->ail_lock);
return error;
}
/* Release the CUI since we're cancelling everything. */
STATIC void
xlog_recover_cancel_cui(
struct xfs_mount *mp,
struct xfs_ail *ailp,
struct xfs_log_item *lip)
{
struct xfs_cui_log_item *cuip;
cuip = container_of(lip, struct xfs_cui_log_item, cui_item);
spin_unlock(&ailp->ail_lock);
xfs_cui_release(cuip);
spin_lock(&ailp->ail_lock);
}
/* Recover the BUI if necessary. */
STATIC int
xlog_recover_process_bui(
@ -2749,9 +2709,6 @@ xlog_recover_process_intents(
* replayed in the wrong order!
*/
switch (lip->li_type) {
case XFS_LI_CUI:
error = xlog_recover_process_cui(parent_tp, ailp, lip);
break;
case XFS_LI_BUI:
error = xlog_recover_process_bui(parent_tp, ailp, lip);
break;
@ -2802,9 +2759,6 @@ xlog_recover_cancel_intents(
}
switch (lip->li_type) {
case XFS_LI_CUI:
xlog_recover_cancel_cui(log->l_mp, ailp, lip);
break;
case XFS_LI_BUI:
xlog_recover_cancel_bui(log->l_mp, ailp, lip);
break;