Deleted Added
full compact
geom_stripe.c (212554) geom_stripe.c (213662)
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/stripe/geom_stripe.c 212554 2010-09-13 13:48:18Z pjd $");
28__FBSDID("$FreeBSD: head/sbin/geom/class/stripe/geom_stripe.c 213662 2010-10-09 20:20:27Z 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>

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

192 name, (intmax_t)compsize, (intmax_t)(msize - ssize));
193 }
194
195 md.md_no = i - 1;
196 md.md_provsize = msize;
197 if (!hardcode)
198 bzero(md.md_provider, sizeof(md.md_provider));
199 else {
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>

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

192 name, (intmax_t)compsize, (intmax_t)(msize - ssize));
193 }
194
195 md.md_no = i - 1;
196 md.md_provsize = msize;
197 if (!hardcode)
198 bzero(md.md_provider, sizeof(md.md_provider));
199 else {
200 if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
201 name += strlen(_PATH_DEV);
200 if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
201 name += sizeof(_PATH_DEV) - 1;
202 strlcpy(md.md_provider, name, sizeof(md.md_provider));
203 }
204 stripe_metadata_encode(&md, sector);
205 error = g_metadata_store(name, sector, sizeof(sector));
206 if (error != 0) {
207 fprintf(stderr, "Can't store metadata on %s: %s.\n",
208 name, strerror(error));
209 gctl_error(req, "Not fully done.");

--- 76 unchanged lines hidden ---
202 strlcpy(md.md_provider, name, sizeof(md.md_provider));
203 }
204 stripe_metadata_encode(&md, sector);
205 error = g_metadata_store(name, sector, sizeof(sector));
206 if (error != 0) {
207 fprintf(stderr, "Can't store metadata on %s: %s.\n",
208 name, strerror(error));
209 gctl_error(req, "Not fully done.");

--- 76 unchanged lines hidden ---