diff options
author | nyan <nyan@FreeBSD.org> | 2002-09-16 07:39:47 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-09-16 07:39:47 +0000 |
commit | 2d1ef1927d8e8aa5553cf3f40a32126e242eb128 (patch) | |
tree | 815c8f8b465f55350a705d7815f13dd972f30cd6 /sys | |
parent | 74d9116c1b728b1bdc595894b3c0d61e524e14d0 (diff) | |
download | FreeBSD-src-2d1ef1927d8e8aa5553cf3f40a32126e242eb128.zip FreeBSD-src-2d1ef1927d8e8aa5553cf3f40a32126e242eb128.tar.gz |
Merged from sys/isa/fd.c revisions 1.234, 1.235 and 1.236.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pc98/cbus/fdc.c | 14 | ||||
-rw-r--r-- | sys/pc98/pc98/fd.c | 14 |
2 files changed, 10 insertions, 18 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 6e9fd41..f71ae4b 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -2148,7 +2148,7 @@ fdstrategy(struct bio *bp) } bp->bio_bcount = (nblocks - blknum) * fdblk; } - bp->bio_pblkno = bp->bio_blkno; + bp->bio_pblkno = blknum; s = splbio(); bioqdisksort(&fdc->head, bp); untimeout(fd_turnoff, fd, fd->toffhandle); /* a good idea */ @@ -3103,6 +3103,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data) struct fd_formb *finfo; struct fdc_readid *idfield; size_t fdblk; + int error; fdu = FDUNIT(minor(dev)); fd = devclass_get_softc(fd_devclass, fdu); @@ -3138,17 +3139,12 @@ fdmisccmd(dev_t dev, u_int cmd, void *data) bp->bio_done = fdbiodone; bp->bio_flags = 0; - /* - * Now run the command. The wait loop is a version of bufwait() - * adapted for struct bio instead of struct buf and specialized - * for the current context. - */ + /* Now run the command. */ fdstrategy(bp); - while ((bp->bio_flags & BIO_DONE) == 0) - tsleep(bp, PRIBIO, "fdcmd", 0); + error = biowait(bp, "fdcmd"); free(bp, M_TEMP); - return (bp->bio_flags & BIO_ERROR ? bp->bio_error : 0); + return (error); } static int diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 6e9fd41..f71ae4b 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -2148,7 +2148,7 @@ fdstrategy(struct bio *bp) } bp->bio_bcount = (nblocks - blknum) * fdblk; } - bp->bio_pblkno = bp->bio_blkno; + bp->bio_pblkno = blknum; s = splbio(); bioqdisksort(&fdc->head, bp); untimeout(fd_turnoff, fd, fd->toffhandle); /* a good idea */ @@ -3103,6 +3103,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data) struct fd_formb *finfo; struct fdc_readid *idfield; size_t fdblk; + int error; fdu = FDUNIT(minor(dev)); fd = devclass_get_softc(fd_devclass, fdu); @@ -3138,17 +3139,12 @@ fdmisccmd(dev_t dev, u_int cmd, void *data) bp->bio_done = fdbiodone; bp->bio_flags = 0; - /* - * Now run the command. The wait loop is a version of bufwait() - * adapted for struct bio instead of struct buf and specialized - * for the current context. - */ + /* Now run the command. */ fdstrategy(bp); - while ((bp->bio_flags & BIO_DONE) == 0) - tsleep(bp, PRIBIO, "fdcmd", 0); + error = biowait(bp, "fdcmd"); free(bp, M_TEMP); - return (bp->bio_flags & BIO_ERROR ? bp->bio_error : 0); + return (error); } static int |