aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2003-06-15 18:13:17 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2003-06-15 18:13:17 +0000
commit83efe35a660704dc918b01d8bd85cc00012a212a (patch)
tree7a3bb2e81c8c54a3e1a9dab413afa53409bc222c /sys
parent29ec21d1e3062f269e6ec330f559b54d5ef909a3 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdc/fdc.c5
-rw-r--r--sys/isa/fd.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index b6ec2c34fcb13..2d835a01a4496 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1669,6 +1669,7 @@ fdstrategy(struct bio *bp)
panic("fdstrategy: buf for nonexistent device (%#lx, %#lx)",
(u_long)major(bp->bio_dev), (u_long)minor(bp->bio_dev));
fdc = fd->fdc;
+ bp->bio_resid = bp->bio_bcount;
if (fd->type == FDT_NONE || fd->ft == 0) {
bp->bio_error = ENXIO;
bp->bio_flags |= BIO_ERROR;
@@ -1712,9 +1713,7 @@ fdstrategy(struct bio *bp)
nblocks = fd->ft->size;
if (blknum + bp->bio_bcount / fdblk > nblocks) {
if (blknum >= nblocks) {
- if (bp->bio_cmd == BIO_READ)
- bp->bio_resid = bp->bio_bcount;
- else {
+ if (bp->bio_cmd != BIO_READ) {
bp->bio_error = ENOSPC;
bp->bio_flags |= BIO_ERROR;
}
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index b6ec2c34fcb13..2d835a01a4496 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -1669,6 +1669,7 @@ fdstrategy(struct bio *bp)
panic("fdstrategy: buf for nonexistent device (%#lx, %#lx)",
(u_long)major(bp->bio_dev), (u_long)minor(bp->bio_dev));
fdc = fd->fdc;
+ bp->bio_resid = bp->bio_bcount;
if (fd->type == FDT_NONE || fd->ft == 0) {
bp->bio_error = ENXIO;
bp->bio_flags |= BIO_ERROR;
@@ -1712,9 +1713,7 @@ fdstrategy(struct bio *bp)
nblocks = fd->ft->size;
if (blknum + bp->bio_bcount / fdblk > nblocks) {
if (blknum >= nblocks) {
- if (bp->bio_cmd == BIO_READ)
- bp->bio_resid = bp->bio_bcount;
- else {
+ if (bp->bio_cmd != BIO_READ) {
bp->bio_error = ENOSPC;
bp->bio_flags |= BIO_ERROR;
}