Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131718142
D9529.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D9529.diff
View Options
Index: head/sbin/mdconfig/mdconfig.c
===================================================================
--- head/sbin/mdconfig/mdconfig.c
+++ head/sbin/mdconfig/mdconfig.c
@@ -452,7 +452,8 @@
}
gc = &pp->lg_config;
type = geom_config_get(gc, "type");
- if (strcmp(type, "vnode") == 0) {
+ if (strcmp(type, "vnode") == 0 ||
+ strcmp(type, "preload") == 0) {
file = geom_config_get(gc, "file");
if (fflag != NULL &&
strcmp(fflag, file) != 0)
Index: head/sys/dev/md/md.c
===================================================================
--- head/sys/dev/md/md.c
+++ head/sys/dev/md/md.c
@@ -1689,7 +1689,8 @@
mdio->md_options = sc->flags;
mdio->md_mediasize = sc->mediasize;
mdio->md_sectorsize = sc->sectorsize;
- if (sc->type == MD_VNODE)
+ if (sc->type == MD_VNODE ||
+ (sc->type == MD_PRELOAD && mdio->md_file != NULL))
error = copyout(sc->file, mdio->md_file,
strlen(sc->file) + 1);
return (error);
@@ -1733,6 +1734,8 @@
sc->pl_ptr = image;
sc->pl_len = length;
sc->start = mdstart_preload;
+ if (name != NULL)
+ strlcpy(sc->file, name, sizeof(sc->file));
#if defined(MD_ROOT) && !defined(ROOTDEVNAME)
if (sc->unit == 0)
rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0";
@@ -1835,7 +1838,8 @@
sbuf_printf(sb, " fs %ju", (uintmax_t) mp->fwsectors);
sbuf_printf(sb, " l %ju", (uintmax_t) mp->mediasize);
sbuf_printf(sb, " t %s", type);
- if (mp->type == MD_VNODE && mp->vnode != NULL)
+ if ((mp->type == MD_VNODE && mp->vnode != NULL) ||
+ (mp->type == MD_PRELOAD && mp->file[0] != '\0'))
sbuf_printf(sb, " file %s", mp->file);
} else {
sbuf_printf(sb, "%s<unit>%d</unit>\n", indent,
@@ -1855,7 +1859,8 @@
"read-only");
sbuf_printf(sb, "%s<type>%s</type>\n", indent,
type);
- if (mp->type == MD_VNODE && mp->vnode != NULL) {
+ if ((mp->type == MD_VNODE && mp->vnode != NULL) ||
+ (mp->type == MD_PRELOAD && mp->file[0] != '\0'))
sbuf_printf(sb, "%s<file>", indent);
g_conf_printf_escaped(sb, "%s", mp->file);
sbuf_printf(sb, "</file>\n");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 2:52 PM (19 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23581184
Default Alt Text
D9529.diff (2 KB)
Attached To
Mode
D9529: Output file name from "preload" type md(4) device
Attached
Detach File
Event Timeline
Log In to Comment