Index: sys/dev/md/md.c
===================================================================
--- sys/dev/md/md.c
+++ sys/dev/md/md.c
@@ -207,6 +207,7 @@
unsigned opencount;
unsigned fwheads;
unsigned fwsectors;
+ char ident[32];
unsigned flags;
char name[20];
struct proc *procp;
@@ -1178,6 +1179,9 @@
sc->fwheads))) ||
g_handleattr_int(bp, "GEOM::candelete", 1))
error = -1;
+ else if (sc->ident[0] != '\0' &&
+ g_handleattr_str(bp, "GEOM::ident", sc->ident))
+ error = -1;
else if (g_handleattr_int(bp, "MNT::verified", isv))
error = -1;
else
@@ -1411,6 +1415,8 @@
sc->fwsectors = mdio->md_fwsectors;
if (mdio->md_fwheads != 0)
sc->fwheads = mdio->md_fwheads;
+ snprintf(sc->ident, sizeof(sc->ident), "MD-DEV%ju-INO%ju",
+ (uintmax_t)vattr.va_fsid, (uintmax_t)vattr.va_fileid);
sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY);
if (!(flags & FWRITE))
sc->flags |= MD_READONLY;
@@ -1895,6 +1901,11 @@
indent, (uintmax_t) mp->fwheads);
sbuf_printf(sb, "%s%ju\n",
indent, (uintmax_t) mp->fwsectors);
+ if (mp->ident[0] != '\0') {
+ sbuf_printf(sb, "%s", indent);
+ g_conf_printf_escaped(sb, "%s", mp->ident);
+ sbuf_printf(sb, "\n");
+ }
sbuf_printf(sb, "%s%ju\n",
indent, (uintmax_t) mp->mediasize);
sbuf_printf(sb, "%s%s\n", indent,