@@ -165,6 +165,32 @@ parse_metapath(
return true;
}
+static bool
+parse_rtgroup(
+ int argc,
+ char **argv,
+ int optind,
+ __u32 *rgno)
+{
+ char *p;
+ unsigned long control;
+
+ if (optind != argc - 1) {
+ fprintf(stderr, _("Must specify one rtgroup number.\n"));
+ return false;
+ }
+
+ control = strtoul(argv[optind], &p, 0);
+ if (*p != '\0') {
+ fprintf(stderr, _("Bad rtgroup number '%s'.\n"),
+ argv[optind]);
+ return false;
+ }
+
+ *rgno = control;
+ return true;
+}
+
static int
parse_args(
int argc,
@@ -230,6 +256,12 @@ parse_args(
return command_usage(cmdinfo);
}
break;
+ case XFROG_SCRUB_GROUP_RTGROUP:
+ if (!parse_rtgroup(argc, argv, optind, &meta->sm_agno)) {
+ exitcode = 1;
+ return command_usage(cmdinfo);
+ }
+ break;
case XFROG_SCRUB_GROUP_FS:
case XFROG_SCRUB_GROUP_NONE:
case XFROG_SCRUB_GROUP_SUMMARY:
@@ -539,6 +571,8 @@ scrubv_f(
group = XFROG_SCRUB_GROUP_ISCAN;
else if (!strcmp(argv[optind], "summary"))
group = XFROG_SCRUB_GROUP_SUMMARY;
+ else if (!strcmp(argv[optind], "rtgroup"))
+ group = XFROG_SCRUB_GROUP_RTGROUP;
else {
printf(_("Unknown group '%s'.\n"), argv[optind]);
exitcode = 1;
@@ -576,6 +610,12 @@ scrubv_f(
return command_usage(&scrubv_cmd);
}
break;
+ case XFROG_SCRUB_GROUP_RTGROUP:
+ if (!parse_rtgroup(argc, argv, optind, &scrubv.head.svh_agno)) {
+ exitcode = 1;
+ return command_usage(&scrubv_cmd);
+ }
+ break;
default:
ASSERT(0);
break;
@@ -1425,11 +1425,12 @@ .SH FILESYSTEM COMMANDS
.RE
.PD
.TP
-.BI "scrub " type " [ " agnumber " | " "ino" " " "gen" " | " metapath " ]"
+.BI "scrub " type " [ " agnumber " | " rgnumber " | " "ino" " " "gen" " | " metapath " ]"
Scrub internal XFS filesystem metadata. The
.BI type
parameter specifies which type of metadata to scrub.
For AG metadata, one AG number must be specified.
+For realtime group metadata, one rtgroup number must be specified.
For file metadata, the scrub is applied to the open file unless the
inode number and generation number are specified.
For metapath, the name of a file or a raw number must be specified.