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/dev/ata | |
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/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 20 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 18 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 18 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 18 |
4 files changed, 10 insertions, 64 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index c5efe55..ae7b94a 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ata-disk.c,v 1.6 1999/04/10 18:53:35 sos Exp $ + * $Id: ata-disk.c,v 1.7 1999/04/16 21:21:53 peter Exp $ */ #include "ata.h" @@ -59,8 +59,8 @@ static d_open_t adopen; static d_close_t adclose; -static d_read_t adread; -static d_write_t adwrite; +static d_read_t physread; +static d_write_t physwrite; static d_ioctl_t adioctl; static d_strategy_t adstrategy; static d_psize_t adpsize; @@ -68,7 +68,7 @@ static d_psize_t adpsize; #define BDEV_MAJOR 30 #define CDEV_MAJOR 116 static struct cdevsw ad_cdevsw = { - adopen, adclose, adread, adwrite, + adopen, adclose, physread, physwrite, adioctl, nostop, nullreset, nodevtotty, #ifdef NOTYET /* the boot code needs to be fixed to boot arbitrary devices */ seltrue, nommap, adstrategy, "ad", @@ -325,18 +325,6 @@ printf("adclose: lun=%d adnlun=%d\n", lun, adnlun); return 0; } -static int -adread(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(adstrategy, NULL, dev, 1, minphys, uio); -} - -static int -adwrite(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(adstrategy, NULL, dev, 0, minphys, uio); -} - static int adioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flags, struct proc *p) { diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 38581cb..4bdfc21 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.5 1999/04/10 18:53:35 sos Exp $ + * $Id: atapi-cd.c,v 1.6 1999/04/27 11:13:54 phk Exp $ */ #include "ata.h" @@ -57,15 +57,13 @@ static d_open_t acdopen; static d_close_t acdclose; -static d_read_t acdread; -static d_write_t acdwrite; static d_ioctl_t acdioctl; static d_strategy_t acdstrategy; #define BDEV_MAJOR 31 #define CDEV_MAJOR 117 static struct cdevsw acd_cdevsw = { - acdopen, acdclose, acdread, acdwrite, + acdopen, acdclose, physread, physwrite, acdioctl, nostop, nullreset, nodevtotty, seltrue, nommap, acdstrategy, "acd", NULL, -1, nodump, nopsize, @@ -456,18 +454,6 @@ acdclose(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) return 0; } -static int -acdread(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(acdstrategy, NULL, dev, 1, minphys, uio); -} - -static int -acdwrite(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(acdstrategy, NULL, dev, 0, minphys, uio); -} - static int acdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) { diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 8d5469b..41f92cf 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-fd.c,v 1.4 1999/03/28 18:57:19 sos Exp $ + * $Id: atapi-fd.c,v 1.5 1999/04/10 18:53:35 sos Exp $ */ #include "ata.h" @@ -58,8 +58,6 @@ static d_open_t afdopen; static d_close_t afdclose; -static d_read_t afdread; -static d_write_t afdwrite; static d_ioctl_t afdioctl; static d_strategy_t afdstrategy; @@ -67,7 +65,7 @@ static d_strategy_t afdstrategy; #define CDEV_MAJOR 118 static struct cdevsw afd_cdevsw = { - afdopen, afdclose, afdread, afdwrite, + afdopen, afdclose, physread, physwrite, afdioctl, nostop, nullreset, nodevtotty, seltrue, nommap, afdstrategy, "afd", NULL, -1, nodump, nopsize, @@ -238,18 +236,6 @@ afdclose(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) return 0; } -static int -afdread(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(afdstrategy, NULL, dev, 1, minphys, uio); -} - -static int -afdwrite(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(afdstrategy, NULL, dev, 0, minphys, uio); -} - static int afdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) { diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index e2ecce1..a436224 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-tape.c,v 1.5 1999/03/28 18:57:19 sos Exp $ + * $Id: atapi-tape.c,v 1.6 1999/04/10 18:53:35 sos Exp $ */ #include "ata.h" @@ -54,8 +54,6 @@ static d_open_t astopen; static d_close_t astclose; -static d_read_t astread; -static d_write_t astwrite; static d_ioctl_t astioctl; static d_strategy_t aststrategy; @@ -63,7 +61,7 @@ static d_strategy_t aststrategy; #define CDEV_MAJOR 119 static struct cdevsw ast_cdevsw = { - astopen, astclose, astread, astwrite, + astopen, astclose, physread, physwrite, astioctl, nostop, nullreset, nodevtotty, seltrue, nommap, aststrategy, "ast", NULL, -1, nodump, nopsize, @@ -260,18 +258,6 @@ astclose(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) return 0; } -static int -astread(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(aststrategy, NULL, dev, 1, minphys, uio); -} - -static int -astwrite(dev_t dev, struct uio *uio, int32_t ioflag) -{ - return physio(aststrategy, NULL, dev, 0, minphys, uio); -} - static int astioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) { |