diff options
author | phk <phk@FreeBSD.org> | 1999-05-07 07:03:47 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-05-07 07:03:47 +0000 |
commit | 7f79e0b14a5e8b99418d156f26b7b4026a163eca (patch) | |
tree | 64910f3b88102ea4099d5b4c903f873d9a777b12 /sys/cam | |
parent | 87d0bb82afc01a49a3747975f2dda83e9e025bd1 (diff) | |
download | FreeBSD-src-7f79e0b14a5e8b99418d156f26b7b4026a163eca.zip FreeBSD-src-7f79e0b14a5e8b99418d156f26b7b4026a163eca.tar.gz |
Introduce two functions: physread() and physwrite() and use these directly
in *devsw[] rather than the 46 local copies of the same functions.
(grog will do the same for vinum when he has time)
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 11 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 20 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_pass.c | 20 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_pt.c | 20 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_sa.c | 26 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_target.c | 6 |
6 files changed, 17 insertions, 86 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index dc23ab3..eb7fd99 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_cd.c,v 1.17 1999/04/19 21:26:17 gibbs Exp $ + * $Id: scsi_cd.c,v 1.18 1999/05/06 20:16:03 ken Exp $ */ /* * Portions of this driver taken from the original FreeBSD cd driver. @@ -177,7 +177,6 @@ static struct cd_quirk_entry cd_quirk_table[] = #define CD_BDEV_MAJOR 6 static d_open_t cdopen; -static d_read_t cdread; static d_close_t cdclose; static d_ioctl_t cdioctl; static d_strategy_t cdstrategy; @@ -248,7 +247,7 @@ static struct cdevsw cd_cdevsw = { /*d_open*/ cdopen, /*d_close*/ cdclose, - /*d_read*/ cdread, + /*d_read*/ physread, /*d_write*/ nowrite, /*d_ioctl*/ cdioctl, /*d_stop*/ nostop, @@ -1031,12 +1030,6 @@ cdclose(dev_t dev, int flag, int fmt, struct proc *p) return (0); } -static int -cdread(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(cdstrategy, NULL, dev, 1, minphys, uio)); -} - static void cdshorttimeout(void *arg) { diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index b603b17..faf2760 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_da.c,v 1.21 1999/03/05 23:20:20 gibbs Exp $ + * $Id: scsi_da.c,v 1.22 1999/05/06 20:16:04 ken Exp $ */ #include "opt_hw_wdog.h" @@ -178,8 +178,6 @@ static struct da_quirk_entry da_quirk_table[] = }; static d_open_t daopen; -static d_read_t daread; -static d_write_t dawrite; static d_close_t daclose; static d_strategy_t dastrategy; static d_ioctl_t daioctl; @@ -242,8 +240,8 @@ static struct cdevsw da_cdevsw = { /*d_open*/ daopen, /*d_close*/ daclose, - /*d_read*/ daread, - /*d_write*/ dawrite, + /*d_read*/ physread, + /*d_write*/ physwrite, /*d_ioctl*/ daioctl, /*d_stop*/ nostop, /*d_reset*/ noreset, @@ -497,18 +495,6 @@ daclose(dev_t dev, int flag, int fmt, struct proc *p) return (0); } -static int -daread(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(dastrategy, NULL, dev, 1, minphys, uio)); -} - -static int -dawrite(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(dastrategy, NULL, dev, 0, minphys, uio)); -} - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index 2f5d973..ab8a7fd 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_pass.c,v 1.6 1999/02/10 00:03:15 ken Exp $ + * $Id: scsi_pass.c,v 1.7 1999/05/06 20:16:05 ken Exp $ */ #include <sys/param.h> @@ -95,8 +95,6 @@ struct pass_softc { #define PASS_CDEV_MAJOR 31 static d_open_t passopen; -static d_read_t passread; -static d_write_t passwrite; static d_close_t passclose; static d_ioctl_t passioctl; static d_strategy_t passstrategy; @@ -127,8 +125,8 @@ static struct cdevsw pass_cdevsw = { /*d_open*/ passopen, /*d_close*/ passclose, - /*d_read*/ passread, - /*d_write*/ passwrite, + /*d_read*/ physread, + /*d_write*/ physwrite, /*d_ioctl*/ passioctl, /*d_stop*/ nostop, /*d_reset*/ noreset, @@ -473,18 +471,6 @@ passclose(dev_t dev, int flag, int fmt, struct proc *p) return (0); } -static int -passread(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(passstrategy, NULL, dev, 1, minphys, uio)); -} - -static int -passwrite(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(passstrategy, NULL, dev, 0, minphys, uio)); -} - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c index 4893284..50469c2 100644 --- a/sys/cam/scsi/scsi_pt.c +++ b/sys/cam/scsi/scsi_pt.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_pt.c,v 1.4 1998/11/22 23:44:47 ken Exp $ + * $Id: scsi_pt.c,v 1.5 1999/02/10 00:03:15 ken Exp $ */ #include <sys/param.h> @@ -82,8 +82,6 @@ struct pt_softc { }; static d_open_t ptopen; -static d_read_t ptread; -static d_write_t ptwrite; static d_close_t ptclose; static d_strategy_t ptstrategy; static periph_init_t ptinit; @@ -118,8 +116,8 @@ static struct cdevsw pt_cdevsw = { /*d_open*/ ptopen, /*d_close*/ ptclose, - /*d_read*/ ptread, - /*d_write*/ ptwrite, + /*d_read*/ physread, + /*d_write*/ physwrite, /*d_ioctl*/ noioctl, /*d_stop*/ nostop, /*d_reset*/ noreset, @@ -207,18 +205,6 @@ ptclose(dev_t dev, int flag, int fmt, struct proc *p) return (0); } -static int -ptread(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(ptstrategy, NULL, dev, 1, minphys, uio)); -} - -static int -ptwrite(dev_t dev, struct uio *uio, int ioflag) -{ - return(physio(ptstrategy, NULL, dev, 0, minphys, uio)); -} - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 8b44c3b..1a1e840 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_sa.c,v 1.20 1999/03/01 01:07:47 mjacob Exp $ + * $Id: scsi_sa.c,v 1.21 1999/04/18 01:05:03 mjacob Exp $ */ #include <sys/param.h> @@ -250,8 +250,6 @@ static struct sa_quirk_entry sa_quirk_table[] = }; static d_open_t saopen; -static d_read_t saread; -static d_write_t sawrite; static d_close_t saclose; static d_strategy_t sastrategy; static d_ioctl_t saioctl; @@ -324,8 +322,8 @@ static struct cdevsw sa_cdevsw = { /*d_open*/ saopen, /*d_close*/ saclose, - /*d_read*/ saread, - /*d_write*/ sawrite, + /*d_read*/ physread, + /*d_write*/ physwrite, /*d_ioctl*/ saioctl, /*d_stop*/ nostop, /*d_reset*/ noreset, @@ -521,24 +519,6 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p) return (0); } -static int -saread(dev_t dev, struct uio *uio, int ioflag) -{ - if (SA_IS_CTRL(dev)) { - return (EINVAL); - } - return(physio(sastrategy, NULL, dev, 1, minphys, uio)); -} - -static int -sawrite(dev_t dev, struct uio *uio, int ioflag) -{ - if (SA_IS_CTRL(dev)) { - return (EINVAL); - } - return(physio(sastrategy, NULL, dev, 0, minphys, uio)); -} - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index bb2bf12..a75b001 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_target.c,v 1.9 1999/03/05 23:25:10 gibbs Exp $ + * $Id: scsi_target.c,v 1.10 1999/05/04 19:24:21 gibbs Exp $ */ #include <stddef.h> /* For offsetof */ @@ -1012,7 +1012,7 @@ targread(dev_t dev, struct uio *uio, int ioflag) targrunqueue(periph, softc); return (0); } - return(physio(targstrategy, NULL, dev, 1, minphys, uio)); + return(physread(dev, uio, ioflag)); } static int @@ -1042,7 +1042,7 @@ targwrite(dev_t dev, struct uio *uio, int ioflag) targrunqueue(periph, softc); return (0); } - return(physio(targstrategy, NULL, dev, 0, minphys, uio)); + return(physwrite(dev, uio, ioflag)); } /* |