summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-07 05:29:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-07 05:29:45 +0000
commite0d66f1005b177e1fbe63f0b4833c5557e3fb6ea (patch)
tree88e76c3cd2014d9c5c56003e79bee033fced261e
parentb6e5dab82a52cac1a2a08f9c1840d091cc9381ab (diff)
in OpenBSD as all old BSD unix, RAW_PART always starts at 0, so no
need for special case code; ok krw
-rw-r--r--sys/dev/ccd.c8
-rw-r--r--sys/dev/flash.c10
-rw-r--r--sys/scsi/cd.c8
-rw-r--r--sys/scsi/sd.c10
4 files changed, 13 insertions, 23 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 7a6047b1c2e..ada88857fd1 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.75 2007/06/06 17:15:13 deraadt Exp $ */
+/* $OpenBSD: ccd.c,v 1.76 2007/06/07 05:29:43 deraadt Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -723,10 +723,8 @@ ccdstart(struct ccd_softc *cs, struct buf *bp)
* Translate the partition-relative block number to an absolute.
*/
bn = bp->b_blkno;
- if (DISKPART(bp->b_dev) != RAW_PART) {
- pp = &cs->sc_dkdev.dk_label->d_partitions[DISKPART(bp->b_dev)];
- bn += DL_GETPOFFSET(pp);
- }
+ pp = &cs->sc_dkdev.dk_label->d_partitions[DISKPART(bp->b_dev)];
+ bn += DL_GETPOFFSET(pp);
/*
* Allocate component buffers
diff --git a/sys/dev/flash.c b/sys/dev/flash.c
index bdc1c6650f5..3f1ff5b4b62 100644
--- a/sys/dev/flash.c
+++ b/sys/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.5 2007/06/06 17:15:13 deraadt Exp $ */
+/* $OpenBSD: flash.c,v 1.6 2007/06/07 05:29:43 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
@@ -904,12 +904,8 @@ _flashstart(struct flash_softc *sc, struct buf *bp)
long pgno;
part = flashpart(bp->b_dev);
- if (part != RAW_PART)
- offset = DL_GETPOFFSET(&sc->sc_dk.dk_label->d_partitions[part]);
- else
- offset = 0;
-
- offset = offset + bp->b_blkno;
+ offset = DL_GETPOFFSET(&sc->sc_dk.dk_label->d_partitions[part]) +
+ bp->b_blkno;
pgno = offset / (sc->sc_flashdev->pagesize / DEV_BSIZE);
/*
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 68d9ebc92f5..bdc1137e8de 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.128 2007/06/06 17:15:14 deraadt Exp $ */
+/* $OpenBSD: cd.c,v 1.129 2007/06/07 05:29:44 deraadt Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -601,10 +601,8 @@ cdstart(void *v)
*/
blkno =
bp->b_blkno / (cd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
- if (DISKPART(bp->b_dev) != RAW_PART) {
- p = &cd->sc_dk.dk_label->d_partitions[DISKPART(bp->b_dev)];
- blkno += DL_GETPOFFSET(p);
- }
+ p = &cd->sc_dk.dk_label->d_partitions[DISKPART(bp->b_dev)];
+ blkno += DL_GETPOFFSET(p);
nblks = howmany(bp->b_bcount, cd->sc_dk.dk_label->d_secsize);
/*
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index f8e99c19be9..1d6eedf937f 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.131 2007/06/06 17:15:14 deraadt Exp $ */
+/* $OpenBSD: sd.c,v 1.132 2007/06/07 05:29:44 deraadt Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -597,7 +597,7 @@ sdstart(void *v)
struct scsi_rw_16 cmd_16;
struct scsi_rw cmd_small;
struct scsi_generic *cmdp;
- int64_t blkno;
+ daddr64_t blkno;
int nblks, cmdlen, error;
struct partition *p;
@@ -649,10 +649,8 @@ sdstart(void *v)
*/
blkno =
bp->b_blkno / (sd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
- if (DISKPART(bp->b_dev) != RAW_PART) {
- p = &sd->sc_dk.dk_label->d_partitions[DISKPART(bp->b_dev)];
- blkno += DL_GETPOFFSET(p);
- }
+ p = &sd->sc_dk.dk_label->d_partitions[DISKPART(bp->b_dev)];
+ blkno += DL_GETPOFFSET(p);
nblks = howmany(bp->b_bcount, sd->sc_dk.dk_label->d_secsize);
/*