Always initialize bio_resid from bio_bcount in the disk mini-layer so

that the drivers don't have to do it umpteen times.
This commit is contained in:
Poul-Henning Kamp 2001-05-08 08:24:54 +00:00
parent a0eb755a9b
commit e0e0b6610e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76361

View file

@ -296,6 +296,7 @@ diskstrategy(struct bio *bp)
pdev = dkmodpart(dkmodslice(bp->bio_dev, WHOLE_DISK_SLICE), RAW_PART);
dp = pdev->si_disk;
bp->bio_resid = bp->bio_bcount;
if (dp != bp->bio_dev->si_disk)
inherit_raw(pdev, bp->bio_dev);
@ -310,7 +311,6 @@ diskstrategy(struct bio *bp)
}
if (bp->bio_bcount == 0) {
bp->bio_resid = 0;
biodone(bp);
return;
}