Subject: Re: To stick or not to stick [ disklabels ]
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 12/09/1999 21:40:06
On Thu, Dec 09, 1999 at 10:27:04AM +0100, Leo Weppelman wrote:
> A proposal to handle sticky disklabels in the current disklabeling sceme:
>
> Add an ioctl, DIOCSTICK, that take a boolean argument. When false, drop
> the disklabel on the next full close, when true, retain the disklabel.
>
> For sd.c, this can be implemented by defining an SDEV_STICKY_LABEL flag
> and changing the end of sdclose() to something like:
>
> if (sd->sc_dk.dk_openmask == 0) {
>
> .....
>
> scsipi_wait_drain(sd->sc_link);
>
> scsipi_prevent(sd->sc_link, PR_ALLOW,
> XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
> sd->sc_link->flags &= ~SDEV_OPEN;
>
> -> if (! (sd->sc_link->flags & SDEV_STICKY_LABEL))
> -> sd->sc_link->flags &= ~SDEV_MEDIA_LOADED;
>
> scsipi_wait_drain(sd->sc_link);
>
> scsipi_adapter_delref(sd->sc_link);
> }
>
>
> For wd.c, something simular can be done.
>
> Are there objections against the above change?
No, looks cool !
--
Manuel Bouyer <bouyer@antioche.eu.org>
--