Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/md/md.c
Show First 20 Lines • Show All 1,785 Lines • ▼ Show 20 Lines | if (sc == NULL) | ||||
return; | return; | ||||
sc->mediasize = length; | sc->mediasize = length; | ||||
sc->sectorsize = DEV_BSIZE; | sc->sectorsize = DEV_BSIZE; | ||||
sc->pl_ptr = image; | sc->pl_ptr = image; | ||||
sc->pl_len = length; | sc->pl_len = length; | ||||
sc->start = mdstart_preload; | sc->start = mdstart_preload; | ||||
if (name != NULL) | if (name != NULL) | ||||
strlcpy(sc->file, name, sizeof(sc->file)); | strlcpy(sc->file, name, sizeof(sc->file)); | ||||
#if defined(MD_ROOT) && !defined(ROOTDEVNAME) | #ifdef MD_ROOT | ||||
if (sc->unit == 0) | if (sc->unit == 0) { | ||||
#ifndef ROOTDEVNAME | |||||
rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; | rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; | ||||
#endif | |||||
#ifdef MD_ROOT_READONLY | |||||
sc->flags |= MD_READONLY; | |||||
#endif | |||||
} | |||||
#endif | #endif | ||||
mdinit(sc); | mdinit(sc); | ||||
if (name != NULL) { | if (name != NULL) { | ||||
printf("%s%d: Preloaded image <%s> %zd bytes at %p\n", | printf("%s%d: Preloaded image <%s> %zd bytes at %p\n", | ||||
MD_NAME, sc->unit, name, length, image); | MD_NAME, sc->unit, name, length, image); | ||||
} else { | } else { | ||||
printf("%s%d: Embedded image %zd bytes at %p\n", | printf("%s%d: Embedded image %zd bytes at %p\n", | ||||
MD_NAME, sc->unit, length, image); | MD_NAME, sc->unit, length, image); | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |