summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-21 19:00:48 +0000
committerphk <phk@FreeBSD.org>2003-02-21 19:00:48 +0000
commit02e550fabbccfb3ee4ca8b767f672f042bce9239 (patch)
tree0a783f7251946cbeba07417df9c459d72a6aa14e /sys
parentc6646c2f7da7d39f3506c8ff46b821f065dc318f (diff)
downloadFreeBSD-src-02e550fabbccfb3ee4ca8b767f672f042bce9239.zip
FreeBSD-src-02e550fabbccfb3ee4ca8b767f672f042bce9239.tar.gz
NO_GEOM cleanup:
Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_da.c8
-rw-r--r--sys/dev/aac/aac_disk.c8
-rw-r--r--sys/dev/ata/ata-disk.c9
-rw-r--r--sys/dev/ida/ida_disk.c8
-rw-r--r--sys/dev/twe/twe_freebsd.c12
-rw-r--r--sys/geom/geom_disk.c4
-rw-r--r--sys/kern/kern_conf.c2
-rw-r--r--sys/kern/subr_xxx.c2
-rw-r--r--sys/sys/conf.h19
-rw-r--r--sys/sys/linedisc.h19
10 files changed, 51 insertions, 40 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 77bc449..fa37690 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -453,7 +453,7 @@ static d_open_t daopen;
static d_close_t daclose;
static d_strategy_t dastrategy;
static d_ioctl_t daioctl;
-static d_dump_t dadump;
+static dumper_t dadump;
static periph_init_t dainit;
static void daasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
@@ -814,14 +814,16 @@ daioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
}
static int
-dadump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
+dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
struct cam_periph *periph;
struct da_softc *softc;
u_int secsize;
struct ccb_scsiio csio;
+ struct disk *dp;
- periph = (struct cam_periph *)dev->si_drv1;
+ dp = arg;
+ periph = (struct cam_periph *)dp->d_dev->si_drv1;
if (periph == NULL)
return (ENXIO);
softc = (struct da_softc *)periph->softc;
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c
index 664cc72..cc777dd 100644
--- a/sys/dev/aac/aac_disk.c
+++ b/sys/dev/aac/aac_disk.c
@@ -66,7 +66,7 @@ static int aac_disk_detach(device_t dev);
static d_open_t aac_disk_open;
static d_close_t aac_disk_close;
static d_strategy_t aac_disk_strategy;
-static d_dump_t aac_disk_dump;
+static dumper_t aac_disk_dump;
#define AAC_DISK_CDEV_MAJOR 151
@@ -241,7 +241,7 @@ aac_dump_map_sg(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
* Send out one command at a time with up to AAC_MAXIO of data.
*/
static int
-aac_disk_dump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
+aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
struct aac_disk *ad;
struct aac_softc *sc;
@@ -251,8 +251,10 @@ aac_disk_dump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size
int size;
static bus_dmamap_t dump_datamap;
static int first = 0;
+ struct disk *dp;
- ad = dev->si_drv1;
+ dp = arg;
+ ad = dp->d_dev->si_drv1;
if (ad == NULL)
return (EINVAL);
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index 6478171..13906ab 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -55,7 +55,7 @@
static d_open_t adopen;
static d_close_t adclose;
static d_strategy_t adstrategy;
-static d_dump_t addump;
+static dumper_t addump;
static struct cdevsw ad_cdevsw = {
/* open */ adopen,
/* close */ adclose,
@@ -315,12 +315,15 @@ adstrategy(struct bio *bp)
}
static int
-addump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
+addump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
- struct ad_softc *adp = dev->si_drv1;
+ struct ad_softc *adp;
struct ad_request request;
static int once;
+ struct disk *dp;
+ dp = arg;
+ adp = dp->d_dev->si_drv1;
if (!adp)
return ENXIO;
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c
index e93dce8..f4265c9 100644
--- a/sys/dev/ida/ida_disk.c
+++ b/sys/dev/ida/ida_disk.c
@@ -61,7 +61,7 @@ static int idad_detach(device_t dev);
static d_open_t idad_open;
static d_close_t idad_close;
static d_strategy_t idad_strategy;
-static d_dump_t idad_dump;
+static dumper_t idad_dump;
#define IDAD_CDEV_MAJOR 109
@@ -180,13 +180,15 @@ bad:
}
static int
-idad_dump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
+idad_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
struct idad_softc *drv;
int error = 0;
+ struct disk *dp;
- drv = idad_getsoftc(dev);
+ dp = arg;
+ drv = idad_getsoftc(dp->d_dev);
if (drv == NULL)
return (ENXIO);
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 95ca2a7..9bc27a3 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -586,7 +586,7 @@ DRIVER_MODULE(twed, twe, twed_driver, twed_devclass, 0, 0);
static d_open_t twed_open;
static d_close_t twed_close;
static d_strategy_t twed_strategy;
-static d_dump_t twed_dump;
+static dumper_t twed_dump;
#define TWED_CDEV_MAJOR 147
@@ -693,12 +693,16 @@ twed_strategy(twe_bio *bp)
* System crashdump support
*/
static int
-twed_dump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
+twed_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
- struct twed_softc *twed_sc = (struct twed_softc *)dev->si_drv1;
- struct twe_softc *twe_sc = (struct twe_softc *)twed_sc->twed_controller;
+ struct twed_softc *twed_sc;
+ struct twe_softc *twe_sc;
int error;
+ struct disk *dp;
+ dp = arg;
+ twed_sc = (struct twed_softc *)dp->d_dev->si_drv1;
+ twe_sc = (struct twe_softc *)twed_sc->twed_controller;
if (!twed_sc || !twe_sc)
return(ENXIO);
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 7cf3c48..22c510e 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -160,7 +160,7 @@ g_disk_kerneldump(struct bio *bp, struct disk *dp)
g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)",
gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length);
di.dumper = dp->d_dump;
- di.priv = dp->d_dev;
+ di.priv = dp;
di.blocksize = dp->d_sectorsize;
di.mediaoffset = gkd->offset;
di.mediasize = gkd->length;
@@ -348,7 +348,7 @@ disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, void *
dp->d_cclose = cdevsw->d_close;
dp->d_cioctl = cdevsw->d_ioctl;
dp->d_strategy = cdevsw->d_strategy;
- dp->d_dump = (dumper_t *)cdevsw->d_dump;
+ dp->d_dump = cdevsw->d_dump;
dp->d_name = cdevsw->d_name;
}
KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy"));
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index d471cd4..22803c1 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -90,7 +90,7 @@ dead_strategy(struct bio *bp)
biofinish(bp, NULL, ENXIO);
}
-#define dead_dump (d_dump_t *)enxio
+#define dead_dump (dumper_t *)enxio
static int
dead_psize(dev_t dev)
diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c
index c9d2676..6730bc7 100644
--- a/sys/kern/subr_xxx.c
+++ b/sys/kern/subr_xxx.c
@@ -143,7 +143,7 @@ nommap(dev, offset, nprot)
}
int
-nodump(dev_t dev, void *virtual __unused, vm_offset_t physical __unused, off_t offset __unused, size_t length __unused)
+nodump(void *arg, void *virtual __unused, vm_offset_t physical __unused, off_t offset __unused, size_t length __unused)
{
return (ENODEV);
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index adb95df..10d09d9 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -151,7 +151,6 @@ typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td);
typedef void d_strategy_t(struct bio *bp);
typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data,
int fflag, struct thread *td);
-typedef int d_dump_t(dev_t dev,void *virtual, vm_offset_t physical, off_t offset, size_t length);
typedef int d_psize_t(dev_t dev);
typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag);
@@ -170,6 +169,13 @@ typedef int l_rint_t(int c, struct tty *tp);
typedef int l_start_t(struct tty *tp);
typedef int l_modem_t(struct tty *tp, int flag);
+typedef int dumper_t(
+ void *priv, /* Private to the driver. */
+ void *virtual, /* Virtual (mapped) address. */
+ vm_offset_t physical, /* Physical address of virtual. */
+ off_t offset, /* Byte-offset to write at. */
+ size_t length); /* Number of bytes to dump. */
+
#define BIO_STRATEGY(bp) \
do { \
if ((!(bp)->bio_cmd) || ((bp)->bio_cmd & ((bp)->bio_cmd - 1))) \
@@ -226,7 +232,7 @@ struct cdevsw {
d_strategy_t *d_strategy;
const char *d_name; /* base device name, e.g. 'vn' */
int d_maj;
- d_dump_t *d_dump;
+ dumper_t *d_dump;
d_psize_t *d_psize;
u_int d_flags;
/* additions below are not binary compatible with 4.2 and below */
@@ -267,7 +273,7 @@ d_kqfilter_t nokqfilter;
#define nostrategy ((d_strategy_t *)NULL)
#define nopoll seltrue
-d_dump_t nodump;
+dumper_t nodump;
#define NUMCDEVSW 256
@@ -344,13 +350,6 @@ EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn);
/* Stuff relating to kernel-dump */
-typedef int dumper_t(
- void *priv, /* Private to the driver. */
- void *virtual, /* Virtual (mapped) address. */
- vm_offset_t physical, /* Physical address of virtual. */
- off_t offset, /* Byte-offset to write at. */
- size_t length); /* Number of bytes to dump. */
-
struct dumperinfo {
dumper_t *dumper; /* Dumping function. */
void *priv; /* Private parts. */
diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h
index adb95df..10d09d9 100644
--- a/sys/sys/linedisc.h
+++ b/sys/sys/linedisc.h
@@ -151,7 +151,6 @@ typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td);
typedef void d_strategy_t(struct bio *bp);
typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data,
int fflag, struct thread *td);
-typedef int d_dump_t(dev_t dev,void *virtual, vm_offset_t physical, off_t offset, size_t length);
typedef int d_psize_t(dev_t dev);
typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag);
@@ -170,6 +169,13 @@ typedef int l_rint_t(int c, struct tty *tp);
typedef int l_start_t(struct tty *tp);
typedef int l_modem_t(struct tty *tp, int flag);
+typedef int dumper_t(
+ void *priv, /* Private to the driver. */
+ void *virtual, /* Virtual (mapped) address. */
+ vm_offset_t physical, /* Physical address of virtual. */
+ off_t offset, /* Byte-offset to write at. */
+ size_t length); /* Number of bytes to dump. */
+
#define BIO_STRATEGY(bp) \
do { \
if ((!(bp)->bio_cmd) || ((bp)->bio_cmd & ((bp)->bio_cmd - 1))) \
@@ -226,7 +232,7 @@ struct cdevsw {
d_strategy_t *d_strategy;
const char *d_name; /* base device name, e.g. 'vn' */
int d_maj;
- d_dump_t *d_dump;
+ dumper_t *d_dump;
d_psize_t *d_psize;
u_int d_flags;
/* additions below are not binary compatible with 4.2 and below */
@@ -267,7 +273,7 @@ d_kqfilter_t nokqfilter;
#define nostrategy ((d_strategy_t *)NULL)
#define nopoll seltrue
-d_dump_t nodump;
+dumper_t nodump;
#define NUMCDEVSW 256
@@ -344,13 +350,6 @@ EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn);
/* Stuff relating to kernel-dump */
-typedef int dumper_t(
- void *priv, /* Private to the driver. */
- void *virtual, /* Virtual (mapped) address. */
- vm_offset_t physical, /* Physical address of virtual. */
- off_t offset, /* Byte-offset to write at. */
- size_t length); /* Number of bytes to dump. */
-
struct dumperinfo {
dumper_t *dumper; /* Dumping function. */
void *priv; /* Private parts. */
OpenPOWER on IntegriCloud