summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-03-31 13:31:45 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-03-31 13:31:45 +0000
commitff08ea6927fb060f17b6e00cc546726507c358d1 (patch)
tree86cbb432e8599588730a7adc8abe31d85f729ce9 /sys
parentd8931b670ff2587301d7b024b027ebac67eb3e09 (diff)
More runtime value initialisation functions.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid_concat.c14
-rw-r--r--sys/dev/softraid_raid1.c12
2 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/softraid_concat.c b/sys/dev/softraid_concat.c
index 1243da84d82..71fd7cd18f9 100644
--- a/sys/dev/softraid_concat.c
+++ b/sys/dev/softraid_concat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_concat.c,v 1.13 2013/03/31 11:12:06 jsing Exp $ */
+/* $OpenBSD: softraid_concat.c,v 1.14 2013/03/31 13:31:44 jsing Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
@@ -36,6 +36,7 @@ int sr_concat_create(struct sr_discipline *, struct bioc_createraid *,
int, int64_t);
int sr_concat_assemble(struct sr_discipline *, struct bioc_createraid *,
int, void *);
+int sr_concat_init(struct sr_discipline *);
int sr_concat_rw(struct sr_workunit *);
/* Discipline initialisation. */
@@ -70,16 +71,21 @@ sr_concat_create(struct sr_discipline *sd, struct bioc_createraid *bc,
for (i = 0; i < no_chunk; i++)
sd->sd_meta->ssdi.ssd_size +=
sd->sd_vol.sv_chunks[i]->src_size;
- sd->sd_max_ccb_per_wu = SR_CONCAT_NOWU * no_chunk;
- return 0;
+ return sr_concat_init(sd);
}
int
sr_concat_assemble(struct sr_discipline *sd, struct bioc_createraid *bc,
int no_chunk, void *data)
{
- sd->sd_max_ccb_per_wu = SR_CONCAT_NOWU * no_chunk;
+ return sr_concat_init(sd);
+}
+
+int
+sr_concat_init(struct sr_discipline *sd)
+{
+ sd->sd_max_ccb_per_wu = SR_CONCAT_NOWU * sd->sd_meta->ssdi.ssd_chunk_no;
return 0;
}
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index 48942ab8548..56037d4b9c0 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.47 2013/03/31 11:12:06 jsing Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.48 2013/03/31 13:31:44 jsing Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -48,6 +48,7 @@ int sr_raid1_create(struct sr_discipline *, struct bioc_createraid *,
int, int64_t);
int sr_raid1_assemble(struct sr_discipline *, struct bioc_createraid *,
int, void *);
+int sr_raid1_init(struct sr_discipline *sd);
int sr_raid1_rw(struct sr_workunit *);
void sr_raid1_intr(struct buf *);
void sr_raid1_set_chunk_state(struct sr_discipline *, int, int);
@@ -85,16 +86,19 @@ sr_raid1_create(struct sr_discipline *sd, struct bioc_createraid *bc,
sd->sd_meta->ssdi.ssd_size = coerced_size;
- sd->sd_max_ccb_per_wu = no_chunk;
-
- return 0;
+ return sr_raid1_init(sd);
}
int
sr_raid1_assemble(struct sr_discipline *sd, struct bioc_createraid *bc,
int no_chunk, void *data)
{
+ return sr_raid1_init(sd);
+}
+int
+sr_raid1_init(struct sr_discipline *sd)
+{
sd->sd_max_ccb_per_wu = sd->sd_meta->ssdi.ssd_chunk_no;
return 0;