Module Name:    src
Committed By:   bsh
Date:           Tue Jul  6 18:09:04 UTC 2010

Modified Files:
        src/sys/dev/ata: ata_raid_intel.c ld_ataraid.c

Log Message:
* use correct interleave factor for RAID-0 of Intel MatrixRaid.
* report stripe size in Kibytes to bioctl(8).

Unfortunately this change will break compatibility with existing
filesystem made by NetBSD on RAID-0 Intel MatrixRAID volumes.

Please read: 
http://mail-index.netbsd.org/current-users/2010/07/02/msg013810.html


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ata/ata_raid_intel.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ata/ld_ataraid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ata_raid_intel.c
diff -u src/sys/dev/ata/ata_raid_intel.c:1.5 src/sys/dev/ata/ata_raid_intel.c:1.6
--- src/sys/dev/ata/ata_raid_intel.c:1.5	Tue Jul  6 18:03:21 2010
+++ src/sys/dev/ata/ata_raid_intel.c	Tue Jul  6 18:09:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $	*/
+/*	$NetBSD: ata_raid_intel.c,v 1.6 2010/07/06 18:09:04 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2000-2008 Søren Schmidt <[email protected]>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_raid_intel.c,v 1.6 2010/07/06 18:09:04 bsh Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -252,7 +252,7 @@
 
 	aai->aai_type = ATA_RAID_TYPE_INTEL;
 	aai->aai_capacity = map->total_sectors;
-	aai->aai_interleave = map->stripe_sectors / 2;
+	aai->aai_interleave = map->stripe_sectors;
 	aai->aai_ndisks = map->total_disks;
 	aai->aai_heads = 255;
 	aai->aai_sectors = 63;

Index: src/sys/dev/ata/ld_ataraid.c
diff -u src/sys/dev/ata/ld_ataraid.c:1.36 src/sys/dev/ata/ld_ataraid.c:1.37
--- src/sys/dev/ata/ld_ataraid.c:1.36	Tue Jul  6 17:56:14 2010
+++ src/sys/dev/ata/ld_ataraid.c	Tue Jul  6 18:09:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $	*/
+/*	$NetBSD: ld_ataraid.c,v 1.37 2010/07/06 18:09:04 bsh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.37 2010/07/06 18:09:04 bsh Exp $");
 
 #include "bio.h"
 #include "rnd.h"
@@ -621,6 +621,7 @@
 {
 	struct ataraid_array_info *aai = sc->sc_aai;
 	struct ld_softc *ld = &sc->sc_ld;
+#define	to_kibytes(ld,s)	(ld->sc_secsize*(s)/1024)
 
 	/* Fill in data for _this_ volume */
 	bv->bv_percent = -1;
@@ -640,7 +641,7 @@
 	switch (aai->aai_level) {
 	case AAI_L_SPAN:
 	case AAI_L_RAID0:
-		bv->bv_stripe_size = aai->aai_interleave;
+		bv->bv_stripe_size = to_kibytes(ld, aai->aai_interleave);
 		bv->bv_level = 0;
 		break;
 	case AAI_L_RAID1:
@@ -648,7 +649,7 @@
 		bv->bv_level = 1;
 		break;
 	case AAI_L_RAID5:
-		bv->bv_stripe_size = aai->aai_interleave;
+		bv->bv_stripe_size = to_kibytes(ld, aai->aai_interleave);
 		bv->bv_level = 5;
 		break;
 	}

Reply via email to