Remove the unused DSO_* options.

This commit is contained in:
Poul-Henning Kamp 2003-01-17 19:36:14 +00:00
parent 1902ba0c83
commit 40f683a443
2 changed files with 6 additions and 36 deletions

View File

@ -658,13 +658,11 @@ dsopen(dev, mode, flags, sspp, lp)
*/ */
*sspp = dsmakeslicestruct(BASE_SLICE, lp); *sspp = dsmakeslicestruct(BASE_SLICE, lp);
if (!(flags & DSO_ONESLICE)) { TRACE(("dsinit\n"));
TRACE(("dsinit\n")); error = dsinit(dev, lp, sspp);
error = dsinit(dev, lp, sspp); if (error != 0) {
if (error != 0) { dsgone(sspp);
dsgone(sspp); return (error);
return (error);
}
} }
ssp = *sspp; ssp = *sspp;
ssp->dss_oflags = flags; ssp->dss_oflags = flags;
@ -719,30 +717,7 @@ dsopen(dev, mode, flags, sspp, lp)
set_ds_wlabel(ssp, slice, TRUE); /* XXX invert */ set_ds_wlabel(ssp, slice, TRUE); /* XXX invert */
lp1 = clone_label(lp); lp1 = clone_label(lp);
TRACE(("readdisklabel\n")); TRACE(("readdisklabel\n"));
if (flags & DSO_NOLABELS) msg = readdisklabel(dev1, lp1);
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);
}
}
if (msg == NULL) if (msg == NULL)
msg = fixlabel(sname, sp, lp1, FALSE); msg = fixlabel(sname, sp, lp1, FALSE);
if (msg == NULL && lp1->d_secsize != ssp->dss_secsize) if (msg == NULL && lp1->d_secsize != ssp->dss_secsize)

View File

@ -68,11 +68,6 @@ struct diskslices {
#ifdef _KERNEL #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) #define dsgetlabel(dev, ssp) (ssp->dss_slices[dkslice(dev)].ds_label)
struct bio; struct bio;