@@ -154,8 +154,20 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
.descr = "directory tree structure",
.group = XFROG_SCRUB_GROUP_INODE,
},
+ [XFS_SCRUB_TYPE_METAPATH] = {
+ .name = "metapath",
+ .descr = "metadata directory paths",
+ .group = XFROG_SCRUB_GROUP_METAPATH,
+ },
+};
+
+const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR] = {
+ [XFS_SCRUB_METAPATH_PROBE] = {
+ .name = "probe",
+ .descr = "metapath",
+ .group = XFROG_SCRUB_GROUP_NONE,
+ },
};
-#undef DEP
/* Invoke the scrub ioctl. Returns zero or negative error code. */
int
@@ -15,6 +15,7 @@ enum xfrog_scrub_group {
XFROG_SCRUB_GROUP_INODE, /* per-inode metadata */
XFROG_SCRUB_GROUP_ISCAN, /* metadata requiring full inode scan */
XFROG_SCRUB_GROUP_SUMMARY, /* summary metadata */
+ XFROG_SCRUB_GROUP_METAPATH, /* metadata directory path */
};
/* Catalog of scrub types and names, indexed by XFS_SCRUB_TYPE_* */
@@ -25,6 +26,7 @@ struct xfrog_scrub_descr {
};
extern const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR];
+extern const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR];
int xfrog_scrub_metadata(struct xfs_fd *xfd, struct xfs_scrub_metadata *meta);
@@ -53,6 +53,22 @@ static const unsigned int scrub_deps[XFS_SCRUB_TYPE_NR] = {
};
#undef DEP
+static int
+format_metapath_descr(
+ char *buf,
+ size_t buflen,
+ struct xfs_scrub_vec_head *vhead)
+{
+ const struct xfrog_scrub_descr *sc;
+
+ if (vhead->svh_ino >= XFS_SCRUB_METAPATH_NR)
+ return snprintf(buf, buflen, _("unknown metadir path %llu"),
+ (unsigned long long)vhead->svh_ino);
+
+ sc = &xfrog_metapaths[vhead->svh_ino];
+ return snprintf(buf, buflen, "%s", _(sc->descr));
+}
+
/* Describe the current state of a vectored scrub. */
int
format_scrubv_descr(
@@ -89,6 +105,8 @@ format_scrubv_descr(
case XFROG_SCRUB_GROUP_ISCAN:
case XFROG_SCRUB_GROUP_NONE:
return snprintf(buf, buflen, _("%s"), _(sc->descr));
+ case XFROG_SCRUB_GROUP_METAPATH:
+ return format_metapath_descr(buf, buflen, vhead);
}
return -1;
}