-/* $OpenBSD: softraid_concat.c,v 1.25 2016/04/12 16:26:54 krw Exp $ */
+/* $OpenBSD: softraid_concat.c,v 1.26 2017/04/28 23:33:07 krw Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
sr_concat_create(struct sr_discipline *sd, struct bioc_createraid *bc,
int no_chunk, int64_t coerced_size)
{
+ int i;
+
if (no_chunk < 2) {
sr_error(sd->sd_sc, "%s requires two or more chunks",
sd->sd_name);
return EINVAL;
}
+
+ sd->sd_meta->ssdi.ssd_size = 0;
+ for (i = 0; i < no_chunk; i++) {
+ sd->sd_meta->ssdi.ssd_size +=
+ sd->sd_vol.sv_chunks[i]->src_size;
+ }
return sr_concat_init(sd);
}