From 610bc1e5aa78603a725e40ec3928dc183d24ab38 Mon Sep 17 00:00:00 2001 From: ad Date: Mon, 18 May 2009 20:41:57 +0000 Subject: [PATCH] Don't pass a buffer to physio(), let it be allocated dynamically. This leaves only scsipi and atapi doing the same. --- sys/arch/hp300/dev/mt.c | 11 ++++------- sys/dev/gpib/mt.c | 10 ++++------ sys/dev/qbus/qd.c | 11 ++++------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/sys/arch/hp300/dev/mt.c b/sys/arch/hp300/dev/mt.c index ccef09a4b63b..e2d5c39b690f 100644 --- a/sys/arch/hp300/dev/mt.c +++ b/sys/arch/hp300/dev/mt.c @@ -1,4 +1,4 @@ -/* $NetBSD: mt.c,v 1.46 2009/01/13 13:35:51 yamt Exp $ */ +/* $NetBSD: mt.c,v 1.47 2009/05/18 20:41:57 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.46 2009/01/13 13:35:51 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.47 2009/05/18 20:41:57 ad Exp $"); #include #include @@ -114,7 +114,6 @@ struct mt_softc { tpr_t sc_ttyp; struct bufq_state *sc_tab;/* buf queue */ int sc_active; - struct buf sc_bufstore; /* XXX buffer storage */ }; #ifdef DEBUG @@ -922,8 +921,7 @@ mtread(dev_t dev, struct uio *uio, int flags) { struct mt_softc *sc = device_lookup_private(&mt_cd,UNIT(dev)); - return physio(mtstrategy, &sc->sc_bufstore, - dev, B_READ, minphys, uio); + return physio(mtstrategy, NULL, dev, B_READ, minphys, uio); } static int @@ -931,8 +929,7 @@ mtwrite(dev_t dev, struct uio *uio, int flags) { struct mt_softc *sc = device_lookup_private(&mt_cd,UNIT(dev)); - return physio(mtstrategy, &sc->sc_bufstore, - dev, B_WRITE, minphys, uio); + return physio(mtstrategy, NULL, dev, B_WRITE, minphys, uio); } static int diff --git a/sys/dev/gpib/mt.c b/sys/dev/gpib/mt.c index 040c907cd8d1..c39fe0087e2e 100644 --- a/sys/dev/gpib/mt.c +++ b/sys/dev/gpib/mt.c @@ -1,4 +1,4 @@ -/* $NetBSD: mt.c,v 1.20 2009/05/12 14:21:58 cegger Exp $ */ +/* $NetBSD: mt.c,v 1.21 2009/05/18 20:41:57 ad Exp $ */ /*- * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. @@ -114,7 +114,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.20 2009/05/12 14:21:58 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.21 2009/05/18 20:41:57 ad Exp $"); #include #include @@ -989,8 +989,7 @@ mtread(dev_t dev, struct uio *uio, int flags) sc = device_lookup_private(&mt_cd, MTUNIT(dev)); - return (physio(mtstrategy, &sc->sc_bufstore, - dev, B_READ, minphys, uio)); + return (physio(mtstrategy, NULL, dev, B_READ, minphys, uio)); } int @@ -1000,8 +999,7 @@ mtwrite(dev_t dev, struct uio *uio, int flags) sc = device_lookup_private(&mt_cd, MTUNIT(dev)); - return (physio(mtstrategy, &sc->sc_bufstore, - dev, B_WRITE, minphys, uio)); + return (physio(mtstrategy, NULL, dev, B_WRITE, minphys, uio)); } int diff --git a/sys/dev/qbus/qd.c b/sys/dev/qbus/qd.c index 746f75ecd1a6..36ff00475a18 100644 --- a/sys/dev/qbus/qd.c +++ b/sys/dev/qbus/qd.c @@ -1,4 +1,4 @@ -/* $NetBSD: qd.c,v 1.49 2009/04/18 14:58:03 tsutsui Exp $ */ +/* $NetBSD: qd.c,v 1.50 2009/05/18 20:41:57 ad Exp $ */ /*- * Copyright (c) 1988 Regents of the University of California. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.49 2009/04/18 14:58:03 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.50 2009/05/18 20:41:57 ad Exp $"); #include "opt_ddb.h" @@ -167,7 +167,6 @@ int Qbus_unmap[NQD]; /* Qbus mapper release code */ struct qdmap qdmap[NQD]; /* QDSS register map structure */ struct qdflags qdflags[NQD]; /* QDSS register map structure */ void *qdbase[NQD]; /* base address of each QDSS unit */ -struct buf qdbuf[NQD]; /* buf structs used by strategy */ short qdopened[NQD]; /* graphics device is open exclusive use */ /* @@ -1640,8 +1639,7 @@ qdwrite(dev_t dev, struct uio *uio, int flag) /* * this is a DMA xfer from user space */ - return (physio(qd_strategy, &qdbuf[unit], - dev, B_WRITE, minphys, uio)); + return (physio(qd_strategy, NULL, dev, B_WRITE, minphys, uio)); } return (ENXIO); } @@ -1667,8 +1665,7 @@ qdread(dev_t dev, struct uio *uio, int flag) /* * this is a bitmap-to-processor xfer */ - return (physio(qd_strategy, &qdbuf[unit], - dev, B_READ, minphys, uio)); + return (physio(qd_strategy, NULL, dev, B_READ, minphys, uio)); } return (ENXIO); }