]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: return the allocated transaction from xchk_trans_alloc_empty
authorChristoph Hellwig <hch@lst.de>
Wed, 16 Jul 2025 12:43:16 +0000 (14:43 +0200)
committerCarlos Maiolino <cem@kernel.org>
Thu, 24 Jul 2025 15:30:13 +0000 (17:30 +0200)
xchk_trans_alloc_empty can't return errors, so return the allocated
transaction directly instead of an output double pointer argument.

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/common.c
fs/xfs/scrub/common.h
fs/xfs/scrub/dir_repair.c
fs/xfs/scrub/fscounters.c
fs/xfs/scrub/metapath.c
fs/xfs/scrub/nlinks.c
fs/xfs/scrub/nlinks_repair.c
fs/xfs/scrub/parent_repair.c
fs/xfs/scrub/quotacheck.c
fs/xfs/scrub/rmap_repair.c
fs/xfs/scrub/rtrmap_repair.c

index d080f4e6e9d8c29dd77c03650b6e5e37e98afb45..2ef7742be7d3da3721fcea3341190958218033a4 100644 (file)
@@ -866,12 +866,11 @@ xchk_trans_cancel(
        sc->tp = NULL;
 }
 
-int
+void
 xchk_trans_alloc_empty(
        struct xfs_scrub        *sc)
 {
        sc->tp = xfs_trans_alloc_empty(sc->mp);
-       return 0;
 }
 
 /*
@@ -893,7 +892,8 @@ xchk_trans_alloc(
                return xfs_trans_alloc(sc->mp, &M_RES(sc->mp)->tr_itruncate,
                                resblks, 0, 0, &sc->tp);
 
-       return xchk_trans_alloc_empty(sc);
+       xchk_trans_alloc_empty(sc);
+       return 0;
 }
 
 /* Set us up with a transaction and an empty context. */
index 19877d99f255b5bf79c1936b885a8c087fa499de..ddbc065c798cd1904a86d88186da7be45f3837ba 100644 (file)
@@ -7,7 +7,7 @@
 #define __XFS_SCRUB_COMMON_H__
 
 int xchk_trans_alloc(struct xfs_scrub *sc, uint resblks);
-int xchk_trans_alloc_empty(struct xfs_scrub *sc);
+void xchk_trans_alloc_empty(struct xfs_scrub *sc);
 void xchk_trans_cancel(struct xfs_scrub *sc);
 
 bool xchk_process_error(struct xfs_scrub *sc, xfs_agnumber_t agno,
index 24931388210872d0a750208a5c30d2fa9fedaef7..8d3b550990b58a649de44bb40b3c23a711f4dbad 100644 (file)
@@ -1289,9 +1289,7 @@ xrep_dir_scan_dirtree(
        if (sc->ilock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL))
                xchk_iunlock(sc, sc->ilock_flags & (XFS_ILOCK_SHARED |
                                                    XFS_ILOCK_EXCL));
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        while ((error = xchk_iscan_iter(&rd->pscan.iscan, &ip)) == 1) {
                bool            flush;
@@ -1317,9 +1315,7 @@ xrep_dir_scan_dirtree(
                        if (error)
                                break;
 
-                       error = xchk_trans_alloc_empty(sc);
-                       if (error)
-                               break;
+                       xchk_trans_alloc_empty(sc);
                }
 
                if (xchk_should_terminate(sc, &error))
index 9b598c5790ad5e5db179e38c1243dd77e91d6569..cebd0d5269260e0cc1e0c8368fed893296d880e2 100644 (file)
@@ -237,7 +237,8 @@ xchk_setup_fscounters(
                        return error;
        }
 
-       return xchk_trans_alloc_empty(sc);
+       xchk_trans_alloc_empty(sc);
+       return 0;
 }
 
 /*
index e21c16fbd15d90ce985dc5dcb59fe5d0bf54a558..14939d7de34966c84e7ce54ad90a705d5453026f 100644 (file)
@@ -318,9 +318,7 @@ xchk_metapath(
                return 0;
        }
 
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        error = xchk_metapath_ilock_both(mpath);
        if (error)
index 4a47d0aabf73bdf078e3c259139a1b0597d299c6..26721fab5cab42f1760c29bff13af9e255dd3f58 100644 (file)
@@ -555,9 +555,7 @@ xchk_nlinks_collect(
         * do not take sb_internal.
         */
        xchk_trans_cancel(sc);
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        while ((error = xchk_iscan_iter(&xnc->collect_iscan, &ip)) == 1) {
                if (S_ISDIR(VFS_I(ip)->i_mode))
@@ -880,9 +878,7 @@ xchk_nlinks_compare(
         * inactivation workqueue.
         */
        xchk_trans_cancel(sc);
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        /*
         * Use the inobt to walk all allocated inodes to compare the link
index 4ebdee09542807060b85a80532feeb02541a36c1..6ef2ee9c3814ae9647a471a0c4c28329deab3d62 100644 (file)
@@ -340,9 +340,7 @@ xrep_nlinks(
                 * We can only push the inactivation workqueues with an empty
                 * transaction.
                 */
-               error = xchk_trans_alloc_empty(sc);
-               if (error)
-                       break;
+               xchk_trans_alloc_empty(sc);
        }
        xchk_iscan_iter_finish(&xnc->compare_iscan);
        xchk_iscan_teardown(&xnc->compare_iscan);
index 31bfe10be22a210910089f9edd177c677672c266..2949feda627175c8fe84dff1b9b9c65cb8b3e19f 100644 (file)
@@ -569,9 +569,7 @@ xrep_parent_scan_dirtree(
        if (sc->ilock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL))
                xchk_iunlock(sc, sc->ilock_flags & (XFS_ILOCK_SHARED |
                                                    XFS_ILOCK_EXCL));
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        while ((error = xchk_iscan_iter(&rp->pscan.iscan, &ip)) == 1) {
                bool            flush;
@@ -597,9 +595,7 @@ xrep_parent_scan_dirtree(
                        if (error)
                                break;
 
-                       error = xchk_trans_alloc_empty(sc);
-                       if (error)
-                               break;
+                       xchk_trans_alloc_empty(sc);
                }
 
                if (xchk_should_terminate(sc, &error))
@@ -1099,9 +1095,7 @@ xrep_parent_flush_xattrs(
        xrep_tempfile_iounlock(rp->sc);
 
        /* Recreate the empty transaction and relock the inode. */
-       error = xchk_trans_alloc_empty(rp->sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(rp->sc);
        xchk_ilock(rp->sc, XFS_ILOCK_EXCL);
        return 0;
 }
index dc4033b91e440b599d9894ed2829c6bca275822f..e4105aaafe8454d16fe3304631af692ef8ab64f2 100644 (file)
@@ -505,9 +505,7 @@ xqcheck_collect_counts(
         * transactions do not take sb_internal.
         */
        xchk_trans_cancel(sc);
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        while ((error = xchk_iscan_iter(&xqc->iscan, &ip)) == 1) {
                error = xqcheck_collect_inode(xqc, ip);
index f5f73078ffe29d3932635d49e6b08ed6c2ac0dc4..bf1e632b449a5c88ecd508270f4f9f4708c21368 100644 (file)
@@ -951,9 +951,7 @@ end_agscan:
        sa->agf_bp = NULL;
        sa->agi_bp = NULL;
        xchk_trans_cancel(sc);
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        /* Iterate all AGs for inodes rmaps. */
        while ((error = xchk_iscan_iter(&rr->iscan, &ip)) == 1) {
index fc2592c53af56926a9adcc6929acf9ddd4ef2e32..4a56726d99522523bcdf8bc871b6c4f3aae8d8bd 100644 (file)
@@ -580,9 +580,7 @@ xrep_rtrmap_find_rmaps(
         */
        xchk_trans_cancel(sc);
        xchk_rtgroup_unlock(&sc->sr);
-       error = xchk_trans_alloc_empty(sc);
-       if (error)
-               return error;
+       xchk_trans_alloc_empty(sc);
 
        while ((error = xchk_iscan_iter(&rr->iscan, &ip)) == 1) {
                error = xrep_rtrmap_scan_inode(rr, ip);