diff options
author | phk <phk@FreeBSD.org> | 1999-05-08 06:40:31 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-05-08 06:40:31 +0000 |
commit | 500e41bd7127ee03db75cd2a3704b8025c24e345 (patch) | |
tree | 8dc80d7dc8cd7f629dab45bcd87aa448cb9a4ca0 /sys/kern/kern_physio.c | |
parent | ed809a974db9e6d86dabb993b9b0c6c49e1bbf32 (diff) | |
download | FreeBSD-src-500e41bd7127ee03db75cd2a3704b8025c24e345.zip FreeBSD-src-500e41bd7127ee03db75cd2a3704b8025c24e345.tar.gz |
I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.
Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)
DEVFS will eventually benefit from this change too.
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r-- | sys/kern/kern_physio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index c2cbb69..5f685b5 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: kern_physio.c,v 1.32 1999/05/06 20:00:25 phk Exp $ + * $Id: kern_physio.c,v 1.33 1999/05/07 07:03:39 phk Exp $ */ #include <sys/param.h> @@ -35,13 +35,13 @@ static struct buf * phygetvpbuf(dev_t dev, int resid); int physread(dev_t dev, struct uio *uio, int ioflag) { - return(physio(cdevsw[major(dev)]->d_strategy, NULL, dev, 1, minphys, uio)); + return(physio(devsw(dev)->d_strategy, NULL, dev, 1, minphys, uio)); } int physwrite(dev_t dev, struct uio *uio, int ioflag) { - return(physio(cdevsw[major(dev)]->d_strategy, NULL, dev, 0, minphys, uio)); + return(physio(devsw(dev)->d_strategy, NULL, dev, 0, minphys, uio)); } int @@ -181,7 +181,7 @@ minphys(bp) u_int maxphys = DFLTPHYS; struct cdevsw *bdsw; - bdsw = cdevsw[major(bp->b_dev)]; + bdsw = devsw(bp->b_dev); if (bdsw && bdsw->d_maxio) { maxphys = bdsw->d_maxio; @@ -206,7 +206,7 @@ phygetvpbuf(dev_t dev, int resid) struct cdevsw *bdsw; int maxio; - bdsw = cdevsw[major(dev)]; + bdsw = devsw(dev); if ((bdsw == NULL) || (bdsw->d_bmaj == -1)) return getpbuf(NULL); |