summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dev.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-10-29 07:16:37 +0000
committerphk <phk@FreeBSD.org>2004-10-29 07:16:37 +0000
commit86cc21c765d6aeea9a1168a037adf88a3ca8d93b (patch)
treeb6292a2891ef76cfdee494defa99c8a504716585 /sys/geom/geom_dev.c
parent616a502e11b454593e49f103df2145e5ba4398dd (diff)
downloadFreeBSD-src-86cc21c765d6aeea9a1168a037adf88a3ca8d93b.zip
FreeBSD-src-86cc21c765d6aeea9a1168a037adf88a3ca8d93b.tar.gz
Give dev_strategy() an explict cdev argument in preparation for removing
buf->b-dev. Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf. Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r--sys/geom/geom_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index fdf9732..e4d5bb0 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -333,7 +333,8 @@ g_dev_done(struct bio *bp2)
g_trace(G_T_BIO, "g_dev_done(%p/%p) resid %ld completed %jd",
bp2, bp, bp->bio_resid, (intmax_t)bp2->bio_completed);
}
- bp->bio_resid = bp->bio_bcount - bp2->bio_completed;
+ bp->bio_resid = bp->bio_length - bp2->bio_completed;
+ bp->bio_completed = bp2->bio_completed;
g_destroy_bio(bp2);
biodone(bp);
}
@@ -371,7 +372,6 @@ g_dev_strategy(struct bio *bp)
tsleep(&bp, PRIBIO, "gdstrat", hz / 10);
}
KASSERT(bp2 != NULL, ("XXX: ENOMEM in a bad place"));
- bp2->bio_length = (off_t)bp->bio_bcount;
bp2->bio_done = g_dev_done;
g_trace(G_T_BIO,
"g_dev_strategy(%p/%p) offset %jd length %jd data %p cmd %d",
OpenPOWER on IntegriCloud