diff options
author | 1995-11-06 21:36:17 +0000 | |
---|---|---|
committer | 1995-11-06 21:36:17 +0000 | |
commit | d9cf08edd8de124fe20d6934150ffa084d91aa5c (patch) | |
tree | 5a347263b41f45770a0d77871f3806f1e993b837 /sys/dev/ccd.c | |
parent | install the correct "ypmake" Makefile (diff) | |
download | wireguard-openbsd-d9cf08edd8de124fe20d6934150ffa084d91aa5c.tar.xz wireguard-openbsd-d9cf08edd8de124fe20d6934150ffa084d91aa5c.zip |
In ccdstart(), only translate the block number from partition-relative
to absolute if part != RAW_PART.
Diffstat (limited to 'sys/dev/ccd.c')
-rw-r--r-- | sys/dev/ccd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 67e0bc87321..759b55b19f6 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.18.2.1 1995/10/12 21:30:16 thorpej Exp $ */ +/* $NetBSD: ccd.c,v 1.18.2.2 1995/11/03 02:40:33 thorpej Exp $ */ /* * Copyright (c) 1995 Jason R. Thorpe. @@ -661,6 +661,7 @@ ccdstart(cs, bp) struct ccdbuf *cbp; caddr_t addr; daddr_t bn; + struct partition *pp; #ifdef DEBUG if (ccddebug & CCDB_FOLLOW) @@ -682,8 +683,11 @@ ccdstart(cs, bp) /* * Translate the partition-relative block number to an absolute. */ - bn = (bp->b_blkno + - cs->sc_dkdev.dk_label.d_partitions[DISKPART(bp->b_dev)].p_offset); + bn = bp->b_blkno; + if (DISKPART(bp->b_dev) != RAW_PART) { + pp = &cs->sc_dkdev.dk_label.d_partitions[DISKPART(bp->b_dev)]; + bn += pp->p_offset; + } /* * Allocate component buffers and fire off the requests |