Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata * use correct interleave factor for RAID-0 of In...



details:   https://anonhg.NetBSD.org/src/rev/d21daeae0157
branches:  trunk
changeset: 756105:d21daeae0157
user:      bsh <bsh%NetBSD.org@localhost>
date:      Tue Jul 06 18:09:04 2010 +0000

description:
* 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

diffstat:

 sys/dev/ata/ata_raid_intel.c |  6 +++---
 sys/dev/ata/ld_ataraid.c     |  9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (71 lines):

diff -r 992e49c066ad -r d21daeae0157 sys/dev/ata/ata_raid_intel.c
--- a/sys/dev/ata/ata_raid_intel.c      Tue Jul 06 18:03:37 2010 +0000
+++ b/sys/dev/ata/ata_raid_intel.c      Tue Jul 06 18:09:04 2010 +0000
@@ -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 <sos%FreeBSD.org@localhost>
@@ -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;
diff -r 992e49c066ad -r d21daeae0157 sys/dev/ata/ld_ataraid.c
--- a/sys/dev/ata/ld_ataraid.c  Tue Jul 06 18:03:37 2010 +0000
+++ b/sys/dev/ata/ld_ataraid.c  Tue Jul 06 18:09:04 2010 +0000
@@ -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;
        }



Home | Main Index | Thread Index | Old Index