diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index fc275459be66..bf515fe1f01a 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -658,13 +658,11 @@ dsopen(dev, mode, flags, sspp, lp) */ *sspp = dsmakeslicestruct(BASE_SLICE, lp); - if (!(flags & DSO_ONESLICE)) { - TRACE(("dsinit\n")); - error = dsinit(dev, lp, sspp); - if (error != 0) { - dsgone(sspp); - return (error); - } + TRACE(("dsinit\n")); + error = dsinit(dev, lp, sspp); + if (error != 0) { + dsgone(sspp); + return (error); } ssp = *sspp; ssp->dss_oflags = flags; @@ -719,30 +717,7 @@ dsopen(dev, mode, flags, sspp, lp) set_ds_wlabel(ssp, slice, TRUE); /* XXX invert */ lp1 = clone_label(lp); TRACE(("readdisklabel\n")); - if (flags & DSO_NOLABELS) - msg = NULL; - else { - msg = readdisklabel(dev1, lp1); - - /* - * readdisklabel() returns NULL for success, and an - * error string for failure. - * - * If there isn't a label on the disk, and if the - * DSO_COMPATLABEL is set, we want to use the - * faked-up label provided by the caller. - * - * So we set msg to NULL to indicate that there is - * no failure (since we have a faked-up label), - * free lp1, and then clone it again from lp. - * (In case readdisklabel() modified lp1.) - */ - if (msg != NULL && (flags & DSO_COMPATLABEL)) { - msg = NULL; - free(lp1, M_DEVBUF); - lp1 = clone_label(lp); - } - } + msg = readdisklabel(dev1, lp1); if (msg == NULL) msg = fixlabel(sname, sp, lp1, FALSE); if (msg == NULL && lp1->d_secsize != ssp->dss_secsize) diff --git a/sys/sys/diskslice.h b/sys/sys/diskslice.h index 277070a5e9c6..99b59a1c8c66 100644 --- a/sys/sys/diskslice.h +++ b/sys/sys/diskslice.h @@ -68,11 +68,6 @@ struct diskslices { #ifdef _KERNEL -/* Flags for dsopen(). */ -#define DSO_NOLABELS 1 -#define DSO_ONESLICE 2 -#define DSO_COMPATLABEL 4 - #define dsgetlabel(dev, ssp) (ssp->dss_slices[dkslice(dev)].ds_label) struct bio;