@@ -183,6 +183,7 @@ parse_args(
break;
case XFROG_SCRUB_GROUP_FS:
case XFROG_SCRUB_GROUP_NONE:
+ case XFROG_SCRUB_GROUP_SUMMARY:
if (!parse_none(argc, optind)) {
exitcode = 1;
return command_usage(cmdinfo);
@@ -132,8 +132,7 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
[XFS_SCRUB_TYPE_FSCOUNTERS] = {
.name = "fscounters",
.descr = "filesystem summary counters",
- .group = XFROG_SCRUB_GROUP_FS,
- .flags = XFROG_SCRUB_DESCR_SUMMARY,
+ .group = XFROG_SCRUB_GROUP_SUMMARY,
},
};
@@ -13,6 +13,7 @@ enum xfrog_scrub_group {
XFROG_SCRUB_GROUP_PERAG, /* per-AG metadata */
XFROG_SCRUB_GROUP_FS, /* per-FS metadata */
XFROG_SCRUB_GROUP_INODE, /* per-inode metadata */
+ XFROG_SCRUB_GROUP_SUMMARY, /* summary metadata */
};
/* Catalog of scrub types and names, indexed by XFS_SCRUB_TYPE_* */
@@ -20,15 +21,8 @@ struct xfrog_scrub_descr {
const char *name;
const char *descr;
enum xfrog_scrub_group group;
- unsigned int flags;
};
-/*
- * The type of metadata checked by this scrubber is a summary of other types
- * of metadata. This scrubber should be run after all the others.
- */
-#define XFROG_SCRUB_DESCR_SUMMARY (1 << 0)
-
extern const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR];
int xfrog_scrub_metadata(struct xfs_fd *xfd, struct xfs_scrub_metadata *meta);
@@ -139,7 +139,7 @@ phase4_func(
* counters, so counter repairs have to be put on the list now so that
* they get fixed before we stop retrying unfixed metadata repairs.
*/
- ret = scrub_fs_summary(ctx, &ctx->action_lists[0]);
+ ret = scrub_fs_counters(ctx, &ctx->action_lists[0]);
if (ret)
return ret;
@@ -116,9 +116,9 @@ phase7_func(
int ip;
int error;
- /* Check and fix the fs summary counters. */
+ /* Check and fix the summary metadata. */
action_list_init(&alist);
- error = scrub_fs_summary(ctx, &alist);
+ error = scrub_summary_metadata(ctx, &alist);
if (error)
return error;
error = action_list_process(ctx, -1, &alist,
@@ -46,6 +46,7 @@ format_scrub_descr(
_(sc->descr));
break;
case XFROG_SCRUB_GROUP_FS:
+ case XFROG_SCRUB_GROUP_SUMMARY:
return snprintf(buf, buflen, _("%s"), _(sc->descr));
break;
case XFROG_SCRUB_GROUP_NONE:
@@ -356,8 +357,6 @@ scrub_group(
if (sc->group != group)
continue;
- if (sc->flags & XFROG_SCRUB_DESCR_SUMMARY)
- continue;
ret = scrub_meta_type(ctx, type, agno, alist);
if (ret)
@@ -410,9 +409,18 @@ scrub_fs_metadata(
return scrub_group(ctx, XFROG_SCRUB_GROUP_FS, 0, alist);
}
-/* Scrub FS summary metadata. */
+/* Scrub all FS summary metadata. */
int
-scrub_fs_summary(
+scrub_summary_metadata(
+ struct scrub_ctx *ctx,
+ struct action_list *alist)
+{
+ return scrub_group(ctx, XFROG_SCRUB_GROUP_SUMMARY, 0, alist);
+}
+
+/* Scrub /only/ the superblock summary counters. */
+int
+scrub_fs_counters(
struct scrub_ctx *ctx,
struct action_list *alist)
{
@@ -23,7 +23,8 @@ int scrub_ag_headers(struct scrub_ctx *ctx, xfs_agnumber_t agno,
int scrub_ag_metadata(struct scrub_ctx *ctx, xfs_agnumber_t agno,
struct action_list *alist);
int scrub_fs_metadata(struct scrub_ctx *ctx, struct action_list *alist);
-int scrub_fs_summary(struct scrub_ctx *ctx, struct action_list *alist);
+int scrub_summary_metadata(struct scrub_ctx *ctx, struct action_list *alist);
+int scrub_fs_counters(struct scrub_ctx *ctx, struct action_list *alist);
bool can_scrub_fs_metadata(struct scrub_ctx *ctx);
bool can_scrub_inode(struct scrub_ctx *ctx);