vinumclose: Fix day-one bug. Subdisks and plexes were not being

marked closed.  This made it impossible to stop Vinum
	    after explicitly opening a plex or subdisk.
This commit is contained in:
Greg Lehey 2003-12-15 00:42:03 +00:00
parent a417109f1f
commit 684873a192

View File

@ -495,13 +495,22 @@ vinumclose(dev_t dev,
case VINUM_PLEX_TYPE:
if (Volno(dev) >= vinum_conf.volumes_allocated)
return ENXIO;
/* FALLTHROUGH */
index = Plexno (dev);
if (index >= vinum_conf.plexes_allocated) /* no such plex */
return ENXIO;
PLEX [index].flags &= ~VF_OPEN; /* no longer open */
return 0;
case VINUM_SD_TYPE:
if ((Volno(dev) >= vinum_conf.volumes_allocated) || /* no such volume */
(Plexno(dev) >= vinum_conf.plexes_allocated)) /* or no such plex */
return ENXIO; /* no such device */
/* FALLTHROUGH */
index = Sdno (dev);
if (index >= vinum_conf.subdisks_allocated) /* no such sd */
return ENXIO;
SD [index].flags &= ~VF_OPEN; /* no longer open */
return 0;
default:
return ENODEV; /* don't know what to do with these */