summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-11-12 10:27:06 +0000
committerphk <phk@FreeBSD.org>2003-11-12 10:27:06 +0000
commit70388f65e9e1216e87bb258d355d13ad30904752 (patch)
treec5275ccfa65a59e73f74820a812643257b712268 /sys/kern
parentc6eb0ef3607d95336e1c5b639c3ab91d07f8a6e9 (diff)
downloadFreeBSD-src-70388f65e9e1216e87bb258d355d13ad30904752.zip
FreeBSD-src-70388f65e9e1216e87bb258d355d13ad30904752.tar.gz
Replace B_PHYS conditional assignment to bio_offset with KASSERT check
to see that the originating code already did it right.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 595d39c..e4a7bd5 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3077,9 +3077,14 @@ dev_strategy(struct buf *bp)
if ((!bp->b_iocmd) || (bp->b_iocmd & (bp->b_iocmd - 1)))
panic("b_iocmd botch");
if (bp->b_flags & B_PHYS)
- bp->b_io.bio_offset = bp->b_offset;
+ KASSERT(bp->b_io.bio_offset == bp->b_offset,
+ ("bio_offset %jd wrong, should be %jd",
+ (intmax_t)bp->b_io.bio_offset, (intmax_t)bp->b_offset));
else
- bp->b_io.bio_offset = dbtob(bp->b_blkno);
+ KASSERT(bp->b_io.bio_offset == dbtob(bp->b_blkno),
+ ("bio_offset %jd wrong, should be %jd",
+ (intmax_t)bp->b_io.bio_offset,
+ (intmax_t)dbtob(bp->b_blkno)));
bp->b_io.bio_done = bufdonebio;
bp->b_io.bio_caller2 = bp;
(*devsw(bp->b_io.bio_dev)->d_strategy)(&bp->b_io);
OpenPOWER on IntegriCloud