]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: collapse trivial superblock scrub helpers
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:23:03 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:06 +0000 (17:01 -0700)
Remove the trivial primary super scrub helper function since it makes
tracing code paths difficult and will become annoying in the patches
that follow.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase2.c
scrub/scrub.c
scrub/scrub.h

index 2d49c604eae64314791baa8dae98cae982e4a870..ec72bb5b71adedb9edf64b3fbde96b27010431b1 100644 (file)
@@ -166,12 +166,13 @@ phase2_func(
        }
 
        /*
-        * In case we ever use the primary super scrubber to perform fs
-        * upgrades (followed by a full scrub), do that before we launch
-        * anything else.
+        * Scrub primary superblock.  This will be useful if we ever need to
+        * hook a filesystem-wide pre-scrub activity (e.g. enable filesystem
+        * upgrades) off of the sb 0 scrubber (which currently does nothing).
+        * If errors occur, this function will log them and return nonzero.
         */
        action_list_init(&alist);
-       ret = scrub_primary_super(ctx, &alist);
+       ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_SB, 0, &alist);
        if (ret)
                goto out_wq;
        ret = action_list_process(ctx, -1, &alist,
index 59583913031842219e737da050b47367f705412c..c2e56e5f1cbc4cd1d1c97967f9936b9929c01b73 100644 (file)
@@ -259,7 +259,7 @@ scrub_save_repair(
  * Returns 0 for success.  If errors occur, this function will log them and
  * return a positive error code.
  */
-static int
+int
 scrub_meta_type(
        struct scrub_ctx                *ctx,
        unsigned int                    type,
@@ -325,20 +325,6 @@ scrub_group(
        return 0;
 }
 
-/*
- * Scrub primary superblock.  This will be useful if we ever need to hook
- * a filesystem-wide pre-scrub activity off of the sb 0 scrubber (which
- * currently does nothing).  If errors occur, this function will log them and
- * return nonzero.
- */
-int
-scrub_primary_super(
-       struct scrub_ctx                *ctx,
-       struct action_list              *alist)
-{
-       return scrub_meta_type(ctx, XFS_SCRUB_TYPE_SB, 0, alist);
-}
-
 /* Scrub each AG's header blocks. */
 int
 scrub_ag_headers(
index 133445e8da6cb76e719d2f842d4dd3c775eeb89d..fef8a596049b7cef712b025606dffa68f9110a56 100644 (file)
@@ -17,7 +17,6 @@ enum check_outcome {
 struct action_item;
 
 void scrub_report_preen_triggers(struct scrub_ctx *ctx);
-int scrub_primary_super(struct scrub_ctx *ctx, struct action_list *alist);
 int scrub_ag_headers(struct scrub_ctx *ctx, xfs_agnumber_t agno,
                struct action_list *alist);
 int scrub_ag_metadata(struct scrub_ctx *ctx, xfs_agnumber_t agno,
@@ -30,6 +29,8 @@ int scrub_fs_counters(struct scrub_ctx *ctx, struct action_list *alist);
 int scrub_quotacheck(struct scrub_ctx *ctx, struct action_list *alist);
 int scrub_nlinks(struct scrub_ctx *ctx, struct action_list *alist);
 int scrub_clean_health(struct scrub_ctx *ctx, struct action_list *alist);
+int scrub_meta_type(struct scrub_ctx *ctx, unsigned int type,
+               xfs_agnumber_t agno, struct action_list *alist);
 
 bool can_scrub_fs_metadata(struct scrub_ctx *ctx);
 bool can_scrub_inode(struct scrub_ctx *ctx);