diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-06-05 18:40:34 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-06-05 18:40:34 +0000 |
commit | c7100f5427c83eff7e8fb092a56cc25524f1454a (patch) | |
tree | 2467438696a81b790f7137ec8043756cc81388ea /sys/scsi | |
parent | 3fbd9089b990f19cc09a737dc7a4123759828e90 (diff) |
Drop kernel support for the useless DIOCWLABEL ioctl and prune a lot
of silly flag twiddling code in various disk drivers.
ok deraadt@, miod@
N.B., users will need a -current disklabel(8) to be able to write new
disklabels to disk now.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 12 | ||||
-rw-r--r-- | sys/scsi/sd.c | 16 | ||||
-rw-r--r-- | sys/scsi/sdvar.h | 4 |
3 files changed, 3 insertions, 29 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index dd8c8cd7717..c53e8b7171c 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.200 2011/06/03 21:14:11 matthew Exp $ */ +/* $OpenBSD: cd.c,v 1.201 2011/06/05 18:40:33 matthew Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -102,8 +102,6 @@ struct cd_softc { int sc_flags; #define CDF_LOCKED 0x01 #define CDF_WANTED 0x02 -#define CDF_WLABEL 0x04 /* label is writable */ -#define CDF_LABELLING 0x08 /* writing label */ #define CDF_ANCIENT 0x10 /* disk is ancient; for minphys */ #define CDF_DYING 0x40 /* dying, when deactivated */ #define CDF_WAITING 0x100 @@ -811,7 +809,6 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) */ if ((sc->sc_link->flags & SDEV_MEDIA_LOADED) == 0) { switch (cmd) { - case DIOCWLABEL: case DIOCLOCK: case DIOCEJECT: case SCIOCIDENTIFY: @@ -880,21 +877,14 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) if ((error = cdlock(sc)) != 0) break; - sc->sc_flags |= CDF_LABELLING; - error = setdisklabel(sc->sc_dk.dk_label, (struct disklabel *)addr, sc->sc_dk.dk_openmask); if (error == 0) { } - sc->sc_flags &= ~CDF_LABELLING; cdunlock(sc); break; - case DIOCWLABEL: - error = EBADF; - break; - case CDIOCPLAYTRACKS: { struct ioc_play_track *args = (struct ioc_play_track *)addr; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index cfe4650b4e7..66805d2c73d 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.227 2011/06/03 21:14:11 matthew Exp $ */ +/* $OpenBSD: sd.c,v 1.228 2011/06/05 18:40:33 matthew Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -880,7 +880,6 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) */ if ((sc->sc_link->flags & SDEV_MEDIA_LOADED) == 0) { switch (cmd) { - case DIOCWLABEL: case DIOCLOCK: case DIOCEJECT: case SCIOCIDENTIFY: @@ -931,7 +930,6 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) if ((error = sdlock(sc)) != 0) goto exit; - sc->flags |= SDF_LABELLING; error = setdisklabel(sc->sc_dk.dk_label, (struct disklabel *)addr, sc->sc_dk.dk_openmask); @@ -941,21 +939,9 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) sdstrategy, sc->sc_dk.dk_label); } - sc->flags &= ~SDF_LABELLING; sdunlock(sc); goto exit; - case DIOCWLABEL: - if ((flag & FWRITE) == 0) { - error = EBADF; - goto exit; - } - if (*(int *)addr) - sc->flags |= SDF_WLABEL; - else - sc->flags &= ~SDF_WLABEL; - goto exit; - case DIOCLOCK: error = scsi_prevent(sc->sc_link, (*(int *)addr) ? PR_PREVENT : PR_ALLOW, 0); diff --git a/sys/scsi/sdvar.h b/sys/scsi/sdvar.h index 60ce2cf182b..da5e299c87f 100644 --- a/sys/scsi/sdvar.h +++ b/sys/scsi/sdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sdvar.h,v 1.34 2010/09/12 02:05:54 krw Exp $ */ +/* $OpenBSD: sdvar.h,v 1.35 2011/06/05 18:40:33 matthew Exp $ */ /* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */ /*- @@ -56,8 +56,6 @@ struct sd_softc { int flags; #define SDF_LOCKED 0x01 #define SDF_WANTED 0x02 -#define SDF_WLABEL 0x04 /* label is writable */ -#define SDF_LABELLING 0x08 /* writing label */ #define SDF_ANCIENT 0x10 /* disk is ancient; for minphys */ #define SDF_DIRTY 0x20 /* disk is dirty; needs cache flush */ #define SDF_DYING 0x40 /* dying, when deactivated */ |