Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_mountroot.c
Show First 20 Lines • Show All 588 Lines • ▼ Show 20 Lines | parse_dir_md(char **conf) | ||||
len = strlen(tok); | len = strlen(tok); | ||||
mdio = malloc(sizeof(*mdio) + len + 1, M_TEMP, M_WAITOK | M_ZERO); | mdio = malloc(sizeof(*mdio) + len + 1, M_TEMP, M_WAITOK | M_ZERO); | ||||
path = (void *)(mdio + 1); | path = (void *)(mdio + 1); | ||||
bcopy(tok, path, len); | bcopy(tok, path, len); | ||||
free(tok, M_TEMP); | free(tok, M_TEMP); | ||||
/* Get file status. */ | /* Get file status. */ | ||||
error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &sb, NULL); | error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &sb); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
/* Open /dev/mdctl so that we can attach/detach. */ | /* Open /dev/mdctl so that we can attach/detach. */ | ||||
error = kern_openat(td, AT_FDCWD, "/dev/" MDCTL_NAME, UIO_SYSSPACE, | error = kern_openat(td, AT_FDCWD, "/dev/" MDCTL_NAME, UIO_SYSSPACE, | ||||
O_RDWR, 0); | O_RDWR, 0); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines |