From 0c7721e8f9f6c719f53f653fd7cf864b6e21cc38 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 11 Sep 2003 19:27:24 +0000 Subject: [PATCH] Disable the use of cloning use in floppy and CD drivers. This commit puts the relevant code snippets under #ifdef GONE_IN_5 (rather than #ifndef BURN_BRIDGES) thereby disabling the code now. The code wil be entirely removed before 5.2 unless we find reasons why this would be a bad idea. Approach suggested by: imp --- sys/cam/scsi/scsi_cd.c | 8 ++++---- sys/dev/ata/atapi-cd.c | 6 +++--- sys/dev/ata/atapi-cd.h | 2 +- sys/dev/fdc/fdc.c | 12 ++++++------ sys/isa/fd.c | 12 ++++++------ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index e321b9636d4f..2f1afb58a2b0 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -152,7 +152,7 @@ struct cd_softc { int bufs_left; struct cam_periph *periph; dev_t dev; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 eventhandler_tag clonetag; #endif int minimum_command_size; @@ -343,7 +343,7 @@ struct cdchanger { static STAILQ_HEAD(changerlist, cdchanger) changerq; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 static void cdclone(void *arg, char *name, int namelen, dev_t *dev) { @@ -535,7 +535,7 @@ cdcleanup(struct cam_periph *periph) } devstat_remove_entry(softc->device_stats); destroy_dev(softc->dev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 EVENTHANDLER_DEREGISTER(dev_clone, softc->clonetag); #endif free(softc, M_DEVBUF); @@ -782,7 +782,7 @@ cdregister(struct cam_periph *periph, void *arg) softc->dev = make_dev(&cd_cdevsw, periph->unit_number, UID_ROOT, GID_OPERATOR, 0640, "cd%d", periph->unit_number); softc->dev->si_drv1 = periph; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 softc->clonetag = EVENTHANDLER_REGISTER(dev_clone, cdclone, softc, 1000); #endif diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index e404b12d7d83..6d8277926f1a 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -243,7 +243,7 @@ acd_detach(struct ata_device *atadev) free(entry, M_ACD); } destroy_dev(cdp->dev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 EVENTHANDLER_DEREGISTER(dev_clone, cdp->clone_evh); #endif devstat_remove_entry(cdp->stats); @@ -276,7 +276,7 @@ acd_init_lun(struct ata_device *atadev) return cdp; } -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 static void acd_clone(void *arg, char *name, int namelen, dev_t *dev) { @@ -305,7 +305,7 @@ acd_make_dev(struct acd_softc *cdp) dev->si_drv1 = cdp; cdp->dev = dev; cdp->device->flags |= ATA_D_MEDIA_CHANGED; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 cdp->clone_evh = EVENTHANDLER_REGISTER(dev_clone, acd_clone, cdp, 1000); #endif acd_set_ioparm(cdp); diff --git a/sys/dev/ata/atapi-cd.h b/sys/dev/ata/atapi-cd.h index 190b651bdcd6..d4a874c14365 100644 --- a/sys/dev/ata/atapi-cd.h +++ b/sys/dev/ata/atapi-cd.h @@ -322,7 +322,7 @@ struct acd_softc { u_int block_size; /* blocksize currently used */ struct devstat *stats; /* devstat entry */ dev_t dev; /* device place holders */ -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 eventhandler_tag clone_evh; #endif }; diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index aed1dacce50a..0dd3b4c183f0 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -317,7 +317,7 @@ struct fd_data { struct callout_handle tohandle; struct devstat *device_stats; dev_t masterdev; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 eventhandler_tag clonetag; dev_t clonedevs[NUMDENS - 1]; #endif @@ -388,7 +388,7 @@ static int fdc_detach(device_t dev); static void fdc_add_child(device_t, const char *, int); static int fdc_attach(device_t); static int fdc_print_child(device_t, device_t); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 static void fd_clone (void *, char *, int, dev_t *); #endif static int fd_probe(device_t); @@ -1121,7 +1121,7 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); #endif /* NCARD > 0 */ -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 /* * Create a clone device upon request by devfs. */ @@ -1331,12 +1331,12 @@ fd_attach(device_t dev) struct fd_data *fd; fd = device_get_softc(dev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 fd->clonetag = EVENTHANDLER_REGISTER(dev_clone, fd_clone, fd, 1000); #endif fd->masterdev = make_dev(&fd_cdevsw, fd->fdu << 6, UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 { int i; for (i = 0; i < NUMDENS - 1; i++) @@ -1359,7 +1359,7 @@ fd_detach(device_t dev) untimeout(fd_turnoff, fd, fd->toffhandle); devstat_remove_entry(fd->device_stats); destroy_dev(fd->masterdev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 { int i; for (i = 0; i < NUMDENS - 1; i++) diff --git a/sys/isa/fd.c b/sys/isa/fd.c index aed1dacce50a..0dd3b4c183f0 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -317,7 +317,7 @@ struct fd_data { struct callout_handle tohandle; struct devstat *device_stats; dev_t masterdev; -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 eventhandler_tag clonetag; dev_t clonedevs[NUMDENS - 1]; #endif @@ -388,7 +388,7 @@ static int fdc_detach(device_t dev); static void fdc_add_child(device_t, const char *, int); static int fdc_attach(device_t); static int fdc_print_child(device_t, device_t); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 static void fd_clone (void *, char *, int, dev_t *); #endif static int fd_probe(device_t); @@ -1121,7 +1121,7 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); #endif /* NCARD > 0 */ -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 /* * Create a clone device upon request by devfs. */ @@ -1331,12 +1331,12 @@ fd_attach(device_t dev) struct fd_data *fd; fd = device_get_softc(dev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 fd->clonetag = EVENTHANDLER_REGISTER(dev_clone, fd_clone, fd, 1000); #endif fd->masterdev = make_dev(&fd_cdevsw, fd->fdu << 6, UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 { int i; for (i = 0; i < NUMDENS - 1; i++) @@ -1359,7 +1359,7 @@ fd_detach(device_t dev) untimeout(fd_turnoff, fd, fd->toffhandle); devstat_remove_entry(fd->device_stats); destroy_dev(fd->masterdev); -#ifndef BURN_BRIDGES +#ifdef GONE_IN_5 { int i; for (i = 0; i < NUMDENS - 1; i++)