Deleted Added
full compact
geom_raid3.c (213662) geom_raid3.c (217305)
1/*-
2 * Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sbin/geom/class/raid3/geom_raid3.c 213662 2010-10-09 20:20:27Z ae $");
28__FBSDID("$FreeBSD: head/sbin/geom/class/raid3/geom_raid3.c 217305 2011-01-12 13:55:01Z ae $");
29
30#include <sys/param.h>
31#include <errno.h>
32#include <paths.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <stdint.h>
36#include <string.h>

--- 171 unchanged lines hidden (view full) ---

208 sectorsize = ssize;
209 else
210 sectorsize = g_lcm(sectorsize, ssize);
211 }
212 md.md_mediasize = mediasize * (nargs - 2);
213 md.md_sectorsize = sectorsize * (nargs - 2);
214 md.md_mediasize -= (md.md_mediasize % md.md_sectorsize);
215
29
30#include <sys/param.h>
31#include <errno.h>
32#include <paths.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <stdint.h>
36#include <string.h>

--- 171 unchanged lines hidden (view full) ---

208 sectorsize = ssize;
209 else
210 sectorsize = g_lcm(sectorsize, ssize);
211 }
212 md.md_mediasize = mediasize * (nargs - 2);
213 md.md_sectorsize = sectorsize * (nargs - 2);
214 md.md_mediasize -= (md.md_mediasize % md.md_sectorsize);
215
216 if (md.md_sectorsize > MAXPHYS) {
217 gctl_error(req, "The blocksize is too big.");
218 return;
219 }
220
216 /*
217 * Clear last sector first, to spoil all components if device exists.
218 */
219 for (i = 1; i < nargs; i++) {
220 str = gctl_get_ascii(req, "arg%d", i);
221 error = g_metadata_clear(str, NULL);
222 if (error != 0) {
223 gctl_error(req, "Can't store metadata on %s: %s.", str,

--- 107 unchanged lines hidden ---
221 /*
222 * Clear last sector first, to spoil all components if device exists.
223 */
224 for (i = 1; i < nargs; i++) {
225 str = gctl_get_ascii(req, "arg%d", i);
226 error = g_metadata_clear(str, NULL);
227 if (error != 0) {
228 gctl_error(req, "Can't store metadata on %s: %s.", str,

--- 107 unchanged lines hidden ---