diff options
author | asami <asami@FreeBSD.org> | 1996-01-31 11:25:46 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1996-01-31 11:25:46 +0000 |
commit | 8b9cb8fedd0f01ebc9c3c594a904b014753b87a3 (patch) | |
tree | 91075511ac77e0c141744e063be029aebef317a0 /sys/geom/geom_ccd.c | |
parent | 6af948881b448b0903d006041d6cf340519a5b11 (diff) | |
download | FreeBSD-src-8b9cb8fedd0f01ebc9c3c594a904b014753b87a3.zip FreeBSD-src-8b9cb8fedd0f01ebc9c3c594a904b014753b87a3.tar.gz |
Fix one warning and fix one bug found while looking at another warning (but
caused by a different reason):
. #ifndef __FreeBSD__ around check for negative size, FreeBSD size_t is
unsigned
. Disable mirror/parity if interleave size is 0 (i.e., serial concatenation).
Diffstat (limited to 'sys/geom/geom_ccd.c')
-rw-r--r-- | sys/geom/geom_ccd.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index c6b349c..68b7f20 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -1,4 +1,4 @@ -/* $Id: ccd.c,v 1.5 1996/01/30 22:34:53 asami Exp $ */ +/* $Id: ccd.c,v 1.6 1996/01/31 03:28:21 asami Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -372,8 +372,10 @@ ccdinit(ccd, cpaths, p) * Calculate the size, truncating to an interleave * boundary if necessary. */ +#ifndef __FreeBSD__ if (size < 0) size = 0; +#endif if (cs->sc_ileave > 1) size -= size % cs->sc_ileave; @@ -1087,6 +1089,12 @@ ccdioctl(dev, cmd, data, flag, p) /* Fill in some important bits. */ ccd.ccd_unit = unit; ccd.ccd_interleave = ccio->ccio_ileave; + if (ccd.ccd_interleave == 0 && + ((ccio->ccio_flags & CCDF_MIRROR) || + (ccio->ccio_flags & CCDF_PARITY))) { + printf("ccd%d: disabling mirror/parity, interleave is 0\n", unit); + ccio->ccio_flags &= ~(CCDF_MIRROR | CCDF_PARITY); + } if ((ccio->ccio_flags & CCDF_MIRROR) && (ccio->ccio_flags & CCDF_PARITY)) { printf("ccd%d: can't specify both mirror and parity, using mirror\n", unit); |