summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-12-07 14:33:39 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-12-07 14:33:39 +0000
commitd1fdcc01a7fd020ab46e7f9fc73e2fb4e75fac99 (patch)
tree7d003cced3815146f681f529eb89a30e7bf37037
parent42321b3620be40357f505baa65d4708c7cef5bdf (diff)
Cleanup discipline initialisation.
ok marco@
-rw-r--r--sys/dev/softraid.c11
-rw-r--r--sys/dev/softraid_raid6.c3
-rw-r--r--sys/dev/softraid_raidp.c5
-rw-r--r--sys/dev/softraidvar.h5
4 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index a7a96e83985..48645afc4eb 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.183 2009/12/07 14:27:12 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.184 2009/12/07 14:33:38 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3246,15 +3246,12 @@ sr_discipline_init(struct sr_discipline *sd, int level)
sr_raid1_discipline_init(sd);
break;
case 4:
+ sr_raidp_discipline_init(sd, SR_MD_RAID4);
+ break;
case 5:
- if (level == 4)
- sd->sd_type = SR_MD_RAID4;
- else
- sd->sd_type = SR_MD_RAID5;
- sr_raidp_discipline_init(sd);
+ sr_raidp_discipline_init(sd, SR_MD_RAID5);
break;
case 6:
- sd->sd_type = SR_MD_RAID6;
sr_raid6_discipline_init(sd);
break;
#ifdef AOE
diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c
index 1d01c4f78e8..1d7eca7ef17 100644
--- a/sys/dev/softraid_raid6.c
+++ b/sys/dev/softraid_raid6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid6.c,v 1.8 2009/12/07 14:27:12 jsing Exp $ */
+/* $OpenBSD: softraid_raid6.c,v 1.9 2009/12/07 14:33:38 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -129,6 +129,7 @@ sr_raid6_discipline_init(struct sr_discipline *sd)
gf_init();
/* fill out discipline members. */
+ sd->sd_type = SR_MD_RAID6;
sd->sd_capabilities = SR_CAP_SYSTEM_DISK | SR_CAP_AUTO_ASSEMBLE;
sd->sd_max_ccb_per_wu = max(6, 2 * sd->sd_meta->ssdi.ssd_chunk_no); /* only if stripsize <= MAXPHYS */
sd->sd_max_wu = SR_RAID6_NOWU;
diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c
index a8b6ea386ca..7ff4ff89dd2 100644
--- a/sys/dev/softraid_raidp.c
+++ b/sys/dev/softraid_raidp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raidp.c,v 1.11 2009/12/07 14:27:12 jsing Exp $ */
+/* $OpenBSD: softraid_raidp.c,v 1.12 2009/12/07 14:33:38 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -65,10 +65,11 @@ void sr_put_block(struct sr_discipline *, void *);
/* discipline initialisation. */
void
-sr_raidp_discipline_init(struct sr_discipline *sd)
+sr_raidp_discipline_init(struct sr_discipline *sd, u_int8_t type)
{
/* fill out discipline members. */
+ sd->sd_type = type;
sd->sd_capabilities = SR_CAP_SYSTEM_DISK | SR_CAP_AUTO_ASSEMBLE;
sd->sd_max_ccb_per_wu = 4; /* only if stripsize <= MAXPHYS */
sd->sd_max_wu = SR_RAIDP_NOWU;
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index 76303ed59c1..786e9af9f65 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.85 2009/12/07 14:27:12 jsing Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.86 2009/12/07 14:33:38 jsing Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -567,7 +567,8 @@ void sr_raid_startwu(struct sr_workunit *);
/* Discipline specific initialisation. */
void sr_raid0_discipline_init(struct sr_discipline *);
void sr_raid1_discipline_init(struct sr_discipline *);
-void sr_raidp_discipline_init(struct sr_discipline *);
+void sr_raidp_discipline_init(struct sr_discipline *,
+ u_int8_t);
void sr_raid6_discipline_init(struct sr_discipline *);
void sr_crypto_discipline_init(struct sr_discipline *);
void sr_aoe_discipline_init(struct sr_discipline *);