]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: pass private data pointer to scan_lbtree
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:21:54 +0000 (14:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:13:18 +0000 (17:13 -0700)
Pass a private data pointer through scan_lbtree.  We'll use this
later when scanning the rtrmapbt to keep track of scan state.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
repair/dinode.c
repair/scan.c
repair/scan.h

index 928392fb914a04b70d6e71eaf2c694de69c937ac..d219c80bad4189cd13f6d79b0b1427f4945560a6 100644 (file)
@@ -839,7 +839,7 @@ _("bad bmap btree ptr 0x%" PRIx64 " in ino %" PRIu64 "\n"),
 
                if (scan_lbtree(get_unaligned_be64(&pp[i]), level, scan_bmapbt,
                                type, whichfork, lino, tot, nex, blkmapp,
-                               &cursor, 1, check_dups, magic,
+                               &cursor, 1, check_dups, magic, NULL,
                                &xfs_bmbt_buf_ops))
                        return(1);
                /*
index 8352b3ccff7d7e292ba5e5803de9146f09d275fb..76d2f62c4f146f1d8ccb88f7ad7f14b98804e426 100644 (file)
@@ -139,7 +139,8 @@ scan_lbtree(
                                int                     isroot,
                                int                     check_dups,
                                int                     *dirty,
-                               uint64_t                magic),
+                               uint64_t                magic,
+                               void                    *priv),
        int             type,
        int             whichfork,
        xfs_ino_t       ino,
@@ -150,6 +151,7 @@ scan_lbtree(
        int             isroot,
        int             check_dups,
        uint64_t        magic,
+       void            *priv,
        const struct xfs_buf_ops *ops)
 {
        struct xfs_buf  *bp;
@@ -181,7 +183,7 @@ scan_lbtree(
        err = (*func)(XFS_BUF_TO_BLOCK(bp), nlevels - 1,
                        type, whichfork, root, ino, tot, nex, blkmapp,
                        bm_cursor, isroot, check_dups, &dirty,
-                       magic);
+                       magic, priv);
 
        ASSERT(dirty == 0 || (dirty && !no_modify));
 
@@ -210,7 +212,8 @@ scan_bmapbt(
        int                     isroot,
        int                     check_dups,
        int                     *dirty,
-       uint64_t                magic)
+       uint64_t                magic,
+       void                    *priv)
 {
        int                     i;
        int                     err;
@@ -486,7 +489,7 @@ _("bad bmap btree ptr 0x%llx in ino %" PRIu64 "\n"),
 
                err = scan_lbtree(be64_to_cpu(pp[i]), level, scan_bmapbt,
                                type, whichfork, ino, tot, nex, blkmapp,
-                               bm_cursor, 0, check_dups, magic,
+                               bm_cursor, 0, check_dups, magic, priv,
                                &xfs_bmbt_buf_ops);
                if (err)
                        return(1);
index ee16362b6d3c693277ec7777af29bdd052d3093b..4da788becbef667924bf57e8fe2fcd0e5345c530 100644 (file)
@@ -26,7 +26,8 @@ int scan_lbtree(
                                int                     isroot,
                                int                     check_dups,
                                int                     *dirty,
-                               uint64_t                magic),
+                               uint64_t                magic,
+                               void                    *priv),
        int             type,
        int             whichfork,
        xfs_ino_t       ino,
@@ -37,6 +38,7 @@ int scan_lbtree(
        int             isroot,
        int             check_dups,
        uint64_t        magic,
+       void            *priv,
        const struct xfs_buf_ops *ops);
 
 int scan_bmapbt(
@@ -53,7 +55,8 @@ int scan_bmapbt(
        int                     isroot,
        int                     check_dups,
        int                     *dirty,
-       uint64_t                magic);
+       uint64_t                magic,
+       void                    *priv);
 
 void
 scan_ags(