]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: remove xrep_trans_{alloc,cancel}_hook_dummy
authorChristoph Hellwig <hch@lst.de>
Wed, 16 Jul 2025 12:43:17 +0000 (14:43 +0200)
committerCarlos Maiolino <cem@kernel.org>
Thu, 24 Jul 2025 15:30:13 +0000 (17:30 +0200)
XFS stopped using current->journal_info in commit f2e812c1522d ("xfs:
don't use current->journal_info"), so there is no point in saving and
restoring it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/repair.c
fs/xfs/scrub/repair.h
fs/xfs/scrub/rmap_repair.c
fs/xfs/scrub/rtrmap_repair.c

index f7f80ff32afc25ed4ac7c5f04b968dffaeb19b43..d00c18954a26b8848c00d43864fba14489d164e6 100644 (file)
@@ -1268,34 +1268,6 @@ xrep_setup_xfbtree(
        return xmbuf_alloc(sc->mp, descr, &sc->xmbtp);
 }
 
-/*
- * Create a dummy transaction for use in a live update hook function.  This
- * function MUST NOT be called from regular repair code because the current
- * process' transaction is saved via the cookie.
- */
-int
-xrep_trans_alloc_hook_dummy(
-       struct xfs_mount        *mp,
-       void                    **cookiep,
-       struct xfs_trans        **tpp)
-{
-       *cookiep = current->journal_info;
-       current->journal_info = NULL;
-       *tpp = xfs_trans_alloc_empty(mp);
-       return 0;
-}
-
-/* Cancel a dummy transaction used by a live update hook function. */
-void
-xrep_trans_cancel_hook_dummy(
-       void                    **cookiep,
-       struct xfs_trans        *tp)
-{
-       xfs_trans_cancel(tp);
-       current->journal_info = *cookiep;
-       *cookiep = NULL;
-}
-
 /*
  * See if this buffer can pass the given ->verify_struct() function.
  *
index af0a3a9e5ed9780825786607aad8b0a72ff66bcf..9c04295742c85f03c2d218019a558a491752710b 100644 (file)
@@ -180,10 +180,6 @@ int xrep_quotacheck(struct xfs_scrub *sc);
 int xrep_reinit_pagf(struct xfs_scrub *sc);
 int xrep_reinit_pagi(struct xfs_scrub *sc);
 
-int xrep_trans_alloc_hook_dummy(struct xfs_mount *mp, void **cookiep,
-               struct xfs_trans **tpp);
-void xrep_trans_cancel_hook_dummy(void **cookiep, struct xfs_trans *tp);
-
 bool xrep_buf_verify_struct(struct xfs_buf *bp, const struct xfs_buf_ops *ops);
 void xrep_inode_set_nblocks(struct xfs_scrub *sc, int64_t new_blocks);
 int xrep_reset_metafile_resv(struct xfs_scrub *sc);
index bf1e632b449a5c88ecd508270f4f9f4708c21368..17d4a38d735cb8cea329929d4ab71051857d6d2f 100644 (file)
@@ -1610,7 +1610,6 @@ xrep_rmapbt_live_update(
        struct xfs_mount                *mp;
        struct xfs_btree_cur            *mcur;
        struct xfs_trans                *tp;
-       void                            *txcookie;
        int                             error;
 
        rr = container_of(nb, struct xrep_rmap, rhook.rmap_hook.nb);
@@ -1621,9 +1620,7 @@ xrep_rmapbt_live_update(
 
        trace_xrep_rmap_live_update(pag_group(rr->sc->sa.pag), action, p);
 
-       error = xrep_trans_alloc_hook_dummy(mp, &txcookie, &tp);
-       if (error)
-               goto out_abort;
+       tp = xfs_trans_alloc_empty(mp);
 
        mutex_lock(&rr->lock);
        mcur = xfs_rmapbt_mem_cursor(rr->sc->sa.pag, tp, &rr->rmap_btree);
@@ -1637,14 +1634,13 @@ xrep_rmapbt_live_update(
        if (error)
                goto out_cancel;
 
-       xrep_trans_cancel_hook_dummy(&txcookie, tp);
+       xfs_trans_cancel(tp);
        mutex_unlock(&rr->lock);
        return NOTIFY_DONE;
 
 out_cancel:
        xfbtree_trans_cancel(&rr->rmap_btree, tp);
-       xrep_trans_cancel_hook_dummy(&txcookie, tp);
-out_abort:
+       xfs_trans_cancel(tp);
        mutex_unlock(&rr->lock);
        xchk_iscan_abort(&rr->iscan);
 out_unlock:
index 4a56726d99522523bcdf8bc871b6c4f3aae8d8bd..7561941a337a1f0417e8a2d9a609a110291ea91c 100644 (file)
@@ -844,7 +844,6 @@ xrep_rtrmapbt_live_update(
        struct xfs_mount                *mp;
        struct xfs_btree_cur            *mcur;
        struct xfs_trans                *tp;
-       void                            *txcookie;
        int                             error;
 
        rr = container_of(nb, struct xrep_rtrmap, rhook.rmap_hook.nb);
@@ -855,9 +854,7 @@ xrep_rtrmapbt_live_update(
 
        trace_xrep_rmap_live_update(rtg_group(rr->sc->sr.rtg), action, p);
 
-       error = xrep_trans_alloc_hook_dummy(mp, &txcookie, &tp);
-       if (error)
-               goto out_abort;
+       tp = xfs_trans_alloc_empty(mp);
 
        mutex_lock(&rr->lock);
        mcur = xfs_rtrmapbt_mem_cursor(rr->sc->sr.rtg, tp, &rr->rtrmap_btree);
@@ -871,14 +868,13 @@ xrep_rtrmapbt_live_update(
        if (error)
                goto out_cancel;
 
-       xrep_trans_cancel_hook_dummy(&txcookie, tp);
+       xfs_trans_cancel(tp);
        mutex_unlock(&rr->lock);
        return NOTIFY_DONE;
 
 out_cancel:
        xfbtree_trans_cancel(&rr->rtrmap_btree, tp);
-       xrep_trans_cancel_hook_dummy(&txcookie, tp);
-out_abort:
+       xfs_trans_cancel(tp);
        xchk_iscan_abort(&rr->iscan);
        mutex_unlock(&rr->lock);
 out_unlock: