diff options
author | asami <asami@FreeBSD.org> | 1996-05-13 08:38:15 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1996-05-13 08:38:15 +0000 |
commit | 8b28728241f28400b342bb62994fa35e3615a807 (patch) | |
tree | 4be1320249550f5fe07c631039fbb4a4812b9729 /sys/dev | |
parent | dc61083d98bdc51b195a310df6a0b84b55b4835f (diff) | |
download | FreeBSD-src-8b28728241f28400b342bb62994fa35e3615a807.zip FreeBSD-src-8b28728241f28400b342bb62994fa35e3615a807.tar.gz |
Leave 16 lines in front of each component partition. It's now safe to
use sd87a or sd237e even if they start at the beginning of the slice.
You can also use sd85c if you prefer, although you need to change the
type field in the disklabel to "4.2BSD".
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ccd/ccd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index cefe093..284d783 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -1,4 +1,4 @@ -/* $Id: ccd.c,v 1.9 1996/03/26 02:29:11 asami Exp $ */ +/* $Id: ccd.c,v 1.10 1996/04/24 09:42:22 asami Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -229,6 +229,13 @@ int numccd = 0; static int ccd_devsw_installed = 0; /* + * Number of blocks to untouched in front of a component partition. + * This is to avoid violating its disklabel area when it starts at the + * beginning of the slice. + */ +#define CCD_OFFSET 16 + +/* * Called by main() during pseudo-device attachment. All we need * to do is allocate enough space for devices to be configured later, and * add devsw entries. @@ -375,7 +382,7 @@ ccdinit(ccd, cpaths, p) maxsecsize = ((dpart.disklab->d_secsize > maxsecsize) ? dpart.disklab->d_secsize : maxsecsize); - size = dpart.part->p_size; + size = dpart.part->p_size - CCD_OFFSET; } else { #ifdef DEBUG if (ccddebug & (CCDB_FOLLOW|CCDB_INIT)) @@ -879,7 +886,7 @@ ccdbuffer(cb, cs, bp, bn, addr, bcount) cbp->cb_buf.b_iodone = (void (*)(struct buf *))ccdiodone; cbp->cb_buf.b_proc = bp->b_proc; cbp->cb_buf.b_dev = ci->ci_dev; /* XXX */ - cbp->cb_buf.b_blkno = cbn + cboff; + cbp->cb_buf.b_blkno = cbn + cboff + CCD_OFFSET; cbp->cb_buf.b_data = addr; cbp->cb_buf.b_vp = ci->ci_vp; if (cs->sc_ileave == 0) |