summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_refcount_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-05-02 02:00:55 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-08 18:50:01 +0300
commit96b60f826713767f222254418c995fb6fd7596b3 (patch)
tree9b26013a61c2a53a1e3375b1bcc7f7603602d208 /fs/xfs/xfs_refcount_item.c
parent889eb55dd68f97729adccb8c06834b35e8bd9590 (diff)
downloadlinux-96b60f826713767f222254418c995fb6fd7596b3.tar.xz
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_refcount_item.c')
-rw-r--r--fs/xfs/xfs_refcount_item.c46
1 files changed, 12 insertions, 34 deletions
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index c7d584b99508..b256eafd30d3 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -421,25 +421,26 @@ const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
* We need to update the refcountbt.
*/
STATIC int
-xfs_cui_recover(
- struct xfs_trans *parent_tp,
- struct xfs_cui_log_item *cuip)
+xfs_cui_item_recover(
+ struct xfs_log_item *lip,
+ struct xfs_trans *parent_tp)
{
- int i;
- int error = 0;
- unsigned int refc_type;
+ struct xfs_bmbt_irec irec;
+ struct xfs_cui_log_item *cuip = CUI_ITEM(lip);
struct xfs_phys_extent *refc;
- xfs_fsblock_t startblock_fsb;
- bool op_ok;
struct xfs_cud_log_item *cudp;
struct xfs_trans *tp;
struct xfs_btree_cur *rcur = NULL;
- enum xfs_refcount_intent_type type;
+ struct xfs_mount *mp = parent_tp->t_mountp;
+ xfs_fsblock_t startblock_fsb;
xfs_fsblock_t new_fsb;
xfs_extlen_t new_len;
- struct xfs_bmbt_irec irec;
+ unsigned int refc_type;
+ bool op_ok;
bool requeue_only = false;
- struct xfs_mount *mp = parent_tp->t_mountp;
+ enum xfs_refcount_intent_type type;
+ int i;
+ int error = 0;
ASSERT(!test_bit(XFS_LI_RECOVERED, &cuip->cui_item.li_flags));
@@ -568,29 +569,6 @@ abort_error:
return error;
}
-/* Recover the CUI if necessary. */
-STATIC int
-xfs_cui_item_recover(
- struct xfs_log_item *lip,
- struct xfs_trans *tp)
-{
- struct xfs_ail *ailp = lip->li_ailp;
- struct xfs_cui_log_item *cuip = CUI_ITEM(lip);
- int error;
-
- /*
- * Skip CUIs that we've already processed.
- */
- if (test_bit(XFS_LI_RECOVERED, &cuip->cui_item.li_flags))
- return 0;
-
- spin_unlock(&ailp->ail_lock);
- error = xfs_cui_recover(tp, cuip);
- spin_lock(&ailp->ail_lock);
-
- return error;
-}
-
STATIC bool
xfs_cui_item_match(
struct xfs_log_item *lip,