summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-06 21:36:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-06 21:36:18 +0000
commitb42b3a455179e86553af199fcaf815bd9726ba87 (patch)
tree4219bdf190590599863ffb798ab039e5b6ad3f65 /sys
parent6585da6868147cbeb1140e22a41a5c1149a7bf3b (diff)
In ccdstart(), only translate the block number from partition-relative
to absolute if part != RAW_PART.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ccd.c10
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