summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-05-01 16:00:55 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-08 08:50:01 -0700
commit96b60f826713767f222254418c995fb6fd7596b3 (patch)
tree9b26013a61c2a53a1e3375b1bcc7f7603602d208 /fs/xfs/xfs_bmap_item.c
parent889eb55dd68f97729adccb8c06834b35e8bd9590 (diff)
xfs: refactor intent item iop_recover calls
Now that we've made the recovered item tests all the same, we can hoist the test and the ail locking code to the ->iop_recover caller and call the recovery function directly. 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_bmap_item.c')
-rw-r--r--fs/xfs/xfs_bmap_item.c48
1 files changed, 13 insertions, 35 deletions
diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c
index 8a5ac8cfd5f2..3b8ca4409aa5 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -421,25 +421,26 @@ const struct xfs_defer_op_type xfs_bmap_update_defer_type = {
* We need to update some inode's bmbt.
*/
STATIC int
-xfs_bui_recover(
- struct xfs_trans *parent_tp,
- struct xfs_bui_log_item *buip)
+xfs_bui_item_recover(
+ struct xfs_log_item *lip,
+ struct xfs_trans *parent_tp)
{
- int error = 0;
- unsigned int bui_type;
+ struct xfs_bmbt_irec irec;
+ struct xfs_bui_log_item *buip = BUI_ITEM(lip);
+ struct xfs_trans *tp;
+ struct xfs_inode *ip = NULL;
+ struct xfs_mount *mp = parent_tp->t_mountp;
struct xfs_map_extent *bmap;
+ struct xfs_bud_log_item *budp;
xfs_fsblock_t startblock_fsb;
xfs_fsblock_t inode_fsb;
xfs_filblks_t count;
- bool op_ok;
- struct xfs_bud_log_item *budp;
+ xfs_exntst_t state;
enum xfs_bmap_intent_type type;
+ bool op_ok;
+ unsigned int bui_type;
int whichfork;
- xfs_exntst_t state;
- struct xfs_trans *tp;
- struct xfs_inode *ip = NULL;
- struct xfs_bmbt_irec irec;
- struct xfs_mount *mp = parent_tp->t_mountp;
+ int error = 0;
ASSERT(!test_bit(XFS_LI_RECOVERED, &buip->bui_item.li_flags));
@@ -555,29 +556,6 @@ err_inode:
return error;
}
-/* Recover the BUI if necessary. */
-STATIC int
-xfs_bui_item_recover(
- struct xfs_log_item *lip,
- struct xfs_trans *tp)
-{
- struct xfs_ail *ailp = lip->li_ailp;
- struct xfs_bui_log_item *buip = BUI_ITEM(lip);
- int error;
-
- /*
- * Skip BUIs that we've already processed.
- */
- if (test_bit(XFS_LI_RECOVERED, &buip->bui_item.li_flags))
- return 0;
-
- spin_unlock(&ailp->ail_lock);
- error = xfs_bui_recover(tp, buip);
- spin_lock(&ailp->ail_lock);
-
- return error;
-}
-
STATIC bool
xfs_bui_item_match(
struct xfs_log_item *lip,