Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/md/md.c
Show First 20 Lines • Show All 1,386 Lines • ▼ Show 20 Lines | mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) | ||||
} else | } else | ||||
strlcpy(sc->file, fname, sizeof(sc->file)); | strlcpy(sc->file, fname, sizeof(sc->file)); | ||||
/* | /* | ||||
* If the user specified that this is a read only device, don't | * If the user specified that this is a read only device, don't | ||||
* set the FWRITE mask before trying to open the backing store. | * set the FWRITE mask before trying to open the backing store. | ||||
*/ | */ | ||||
flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \ | flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \ | ||||
| ((mdio->md_options & MD_VERIFY) ? 0 : O_VERIFY); | | ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0); | ||||
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); | NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); | ||||
error = vn_open(&nd, &flags, 0, NULL); | error = vn_open(&nd, &flags, 0, NULL); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
NDFREE(&nd, NDF_ONLY_PNBUF); | NDFREE(&nd, NDF_ONLY_PNBUF); | ||||
if (nd.ni_vp->v_type != VREG) { | if (nd.ni_vp->v_type != VREG) { | ||||
error = EINVAL; | error = EINVAL; | ||||
goto bad; | goto bad; | ||||
▲ Show 20 Lines • Show All 547 Lines • Show Last 20 Lines |