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/dev | |
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/dev')
-rw-r--r-- | sys/dev/snp/snp.c | 2 | ||||
-rw-r--r-- | sys/dev/vinum/vinumio.c | 4 | ||||
-rw-r--r-- | sys/dev/vinum/vinumrequest.c | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index ebffb2a..204088c 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -71,7 +71,7 @@ snpdevtotty (dev) maj = major(dev); if ((u_int)maj >= nchrdev) return (NULL); - cdp = cdevsw[maj]; + cdp = devsw(dev); if (cdp == NULL) return (NULL); return ((*cdp->d_devtotty)(dev)); diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c index 2651205..9faf767 100644 --- a/sys/dev/vinum/vinumio.c +++ b/sys/dev/vinum/vinumio.c @@ -33,7 +33,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumio.c,v 1.23 1999/05/07 01:32:09 grog Exp $ + * $Id: vinumio.c,v 1.24 1999/05/07 10:10:04 phk Exp $ */ #include <dev/vinum/vinumhdr.h> @@ -285,7 +285,7 @@ driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag) bp->b_bcount = len; bp->b_bufsize = len; - (*bdevsw(major(bp->b_dev))->d_strategy) (bp); /* initiate the transfer */ + (*bdevsw(bp->b_dev)->d_strategy) (bp); /* initiate the transfer */ error = biowait(bp); printf("driveio: %s dev 0x%x, block 0x%x, len 0x%lx, error %d\n", /* XXX */ diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c index 477ec40..a05c6e6 100644 --- a/sys/dev/vinum/vinumrequest.c +++ b/sys/dev/vinum/vinumrequest.c @@ -33,7 +33,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumrequest.c,v 1.21 1999/05/07 08:07:09 grog Exp $ + * $Id: vinumrequest.c,v 1.22 1999/05/07 10:10:07 phk Exp $ */ #include <dev/vinum/vinumhdr.h> @@ -390,7 +390,7 @@ launch_requests(struct request *rq, int reviveok) logrq(loginfo_rqe, (union rqinfou) rqe, rq->bp); #endif /* fire off the request */ - (*bdevsw(major(rqe->b.b_dev))->d_strategy) (&rqe->b); + (*bdevsw(rqe->b.b_dev)->d_strategy) (&rqe->b); } /* XXX Do we need caching? Think about this more */ } @@ -865,7 +865,7 @@ sdio(struct buf *bp) sbp->b.b_vp->v_numoutput); #endif s = splbio(); - (*bdevsw(major(sbp->b.b_dev))->d_strategy) (&sbp->b); + (*bdevsw(sbp->b.b_dev)->d_strategy) (&sbp->b); splx(s); } |