View | Details | Raw Unified | Return to bug 235473
Collapse All | Expand All

(-)lib/geom/concat/geom_concat.c (+3 lines)
Lines 59-64 Link Here
59
	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS,
59
	{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS,
60
	    "[-v] name prov ..."
60
	    "[-v] name prov ..."
61
	},
61
	},
62
	{ "append", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
63
	    "[-v] name prov"
64
	},
62
	{ "destroy", G_FLAG_VERBOSE, NULL,
65
	{ "destroy", G_FLAG_VERBOSE, NULL,
63
	    {
66
	    {
64
		{ 'f', "force", NULL, G_TYPE_BOOL },
67
		{ 'f', "force", NULL, G_TYPE_BOOL },
(-)sys/geom/concat/g_concat.c (-6 / +241 lines)
Lines 35-40 Link Here
35
#include <sys/module.h>
35
#include <sys/module.h>
36
#include <sys/lock.h>
36
#include <sys/lock.h>
37
#include <sys/mutex.h>
37
#include <sys/mutex.h>
38
#include <sys/sx.h>
38
#include <sys/bio.h>
39
#include <sys/bio.h>
39
#include <sys/sbuf.h>
40
#include <sys/sbuf.h>
40
#include <sys/sysctl.h>
41
#include <sys/sysctl.h>
Lines 104-109 Link Here
104
{
105
{
105
	u_int i, no;
106
	u_int i, no;
106
107
108
	sx_assert(&sc->sc_lock_append, SA_LOCKED);
109
107
	no = 0;
110
	no = 0;
108
	for (i = 0; i < sc->sc_ndisks; i++) {
111
	for (i = 0; i < sc->sc_ndisks; i++) {
109
		if (sc->sc_disks[i].d_consumer != NULL)
112
		if (sc->sc_disks[i].d_consumer != NULL)
Lines 172-181 Link Here
172
	struct g_consumer *cp1, *cp2, *tmp;
175
	struct g_consumer *cp1, *cp2, *tmp;
173
	struct g_concat_disk *disk;
176
	struct g_concat_disk *disk;
174
	struct g_geom *gp;
177
	struct g_geom *gp;
178
	struct g_concat_softc *sc;
175
	int error;
179
	int error;
176
180
177
	g_topology_assert();
181
	g_topology_assert();
178
	gp = pp->geom;
182
	gp = pp->geom;
183
	sc = gp->softc;
179
184
180
	/* On first open, grab an extra "exclusive" bit */
185
	/* On first open, grab an extra "exclusive" bit */
181
	if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)
186
	if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)
Lines 184-189 Link Here
184
	if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0)
189
	if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0)
185
		de--;
190
		de--;
186
191
192
	sx_slock(&sc->sc_lock_append);
187
	LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) {
193
	LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) {
188
		error = g_access(cp1, dr, dw, de);
194
		error = g_access(cp1, dr, dw, de);
189
		if (error != 0)
195
		if (error != 0)
Lines 194-202 Link Here
194
			g_concat_remove_disk(disk); /* May destroy geom. */
200
			g_concat_remove_disk(disk); /* May destroy geom. */
195
		}
201
		}
196
	}
202
	}
203
	sx_sunlock(&sc->sc_lock_append);
197
	return (0);
204
	return (0);
198
205
199
fail:
206
fail:
207
	sx_sunlock(&sc->sc_lock_append);
200
	LIST_FOREACH(cp2, &gp->consumer, consumer) {
208
	LIST_FOREACH(cp2, &gp->consumer, consumer) {
201
		if (cp1 == cp2)
209
		if (cp1 == cp2)
202
			break;
210
			break;
Lines 213-218 Link Here
213
	int i, val;
221
	int i, val;
214
222
215
	sc = bp->bio_to->geom->softc;
223
	sc = bp->bio_to->geom->softc;
224
	sx_assert(&sc->sc_lock_append, SX_LOCKED);
216
	for (i = 0; i < sc->sc_ndisks; i++) {
225
	for (i = 0; i < sc->sc_ndisks; i++) {
217
		disk = &sc->sc_disks[i];
226
		disk = &sc->sc_disks[i];
218
		if (!disk->d_removed && disk->d_candelete)
227
		if (!disk->d_removed && disk->d_candelete)
Lines 284-289 Link Here
284
	struct bio *cbp;
293
	struct bio *cbp;
285
	u_int no;
294
	u_int no;
286
295
296
	sx_assert(&sc->sc_lock_append, SX_LOCKED);
297
287
	bioq_init(&queue);
298
	bioq_init(&queue);
288
	for (no = 0; no < sc->sc_ndisks; no++) {
299
	for (no = 0; no < sc->sc_ndisks; no++) {
289
		cbp = g_clone_bio(bp);
300
		cbp = g_clone_bio(bp);
Lines 331-336 Link Here
331
	    bp->bio_to->error, bp->bio_to->name));
342
	    bp->bio_to->error, bp->bio_to->name));
332
343
333
	G_CONCAT_LOGREQ(bp, "Request received.");
344
	G_CONCAT_LOGREQ(bp, "Request received.");
345
	sx_slock(&sc->sc_lock_append);
334
346
335
	switch (bp->bio_cmd) {
347
	switch (bp->bio_cmd) {
336
	case BIO_READ:
348
	case BIO_READ:
Lines 339-358 Link Here
339
		break;
351
		break;
340
	case BIO_FLUSH:
352
	case BIO_FLUSH:
341
		g_concat_flush(sc, bp);
353
		g_concat_flush(sc, bp);
342
		return;
354
		goto end;
343
	case BIO_GETATTR:
355
	case BIO_GETATTR:
344
		if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) {
356
		if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) {
345
			g_concat_kernel_dump(bp);
357
			g_concat_kernel_dump(bp);
346
			return;
358
			goto end;
347
		} else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) {
359
		} else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) {
348
			g_concat_candelete(bp);
360
			g_concat_candelete(bp);
349
			return;
361
			goto end;
350
		}
362
		}
351
		/* To which provider it should be delivered? */
363
		/* To which provider it should be delivered? */
352
		/* FALLTHROUGH */
364
		/* FALLTHROUGH */
353
	default:
365
	default:
354
		g_io_deliver(bp, EOPNOTSUPP);
366
		g_io_deliver(bp, EOPNOTSUPP);
355
		return;
367
		goto end;
356
	}
368
	}
357
369
358
	offset = bp->bio_offset;
370
	offset = bp->bio_offset;
Lines 383-389 Link Here
383
			if (bp->bio_error == 0)
395
			if (bp->bio_error == 0)
384
				bp->bio_error = ENOMEM;
396
				bp->bio_error = ENOMEM;
385
			g_io_deliver(bp, bp->bio_error);
397
			g_io_deliver(bp, bp->bio_error);
386
			return;
398
			goto end;
387
		}
399
		}
388
		bioq_insert_tail(&queue, cbp);
400
		bioq_insert_tail(&queue, cbp);
389
		/*
401
		/*
Lines 419-424 Link Here
419
		cbp->bio_caller1 = NULL;
431
		cbp->bio_caller1 = NULL;
420
		g_io_request(cbp, disk->d_consumer);
432
		g_io_request(cbp, disk->d_consumer);
421
	}
433
	}
434
end:
435
	sx_sunlock(&sc->sc_lock_append);
422
}
436
}
423
437
424
static void
438
static void
Lines 519-532 Link Here
519
	int error;
533
	int error;
520
534
521
	g_topology_assert();
535
	g_topology_assert();
536
537
	sx_slock(&sc->sc_lock_append);
538
	
522
	/* Metadata corrupted? */
539
	/* Metadata corrupted? */
523
	if (no >= sc->sc_ndisks)
540
	if (no >= sc->sc_ndisks)
541
	{
542
		sx_sunlock(&sc->sc_lock_append);
524
		return (EINVAL);
543
		return (EINVAL);
544
	}
525
545
526
	disk = &sc->sc_disks[no];
546
	disk = &sc->sc_disks[no];
527
	/* Check if disk is not already attached. */
547
	/* Check if disk is not already attached. */
528
	if (disk->d_consumer != NULL)
548
	if (disk->d_consumer != NULL)
549
	{
550
		sx_sunlock(&sc->sc_lock_append);
529
		return (EEXIST);
551
		return (EEXIST);
552
	}
530
553
531
	gp = sc->sc_geom;
554
	gp = sc->sc_geom;
532
	fcp = LIST_FIRST(&gp->consumer);
555
	fcp = LIST_FIRST(&gp->consumer);
Lines 535-540 Link Here
535
	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
558
	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
536
	error = g_attach(cp, pp);
559
	error = g_attach(cp, pp);
537
	if (error != 0) {
560
	if (error != 0) {
561
		sx_sunlock(&sc->sc_lock_append);
538
		g_destroy_consumer(cp);
562
		g_destroy_consumer(cp);
539
		return (error);
563
		return (error);
540
	}
564
	}
Lines 542-547 Link Here
542
	if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0)) {
566
	if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0)) {
543
		error = g_access(cp, fcp->acr, fcp->acw, fcp->ace);
567
		error = g_access(cp, fcp->acr, fcp->acw, fcp->ace);
544
		if (error != 0) {
568
		if (error != 0) {
569
			sx_sunlock(&sc->sc_lock_append);
545
			g_detach(cp);
570
			g_detach(cp);
546
			g_destroy_consumer(cp);
571
			g_destroy_consumer(cp);
547
			return (error);
572
			return (error);
Lines 550-557 Link Here
550
	if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) {
575
	if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) {
551
		struct g_concat_metadata md;
576
		struct g_concat_metadata md;
552
577
578
		// temporarilygive up the lock to avoid lock order violation
579
		// due to topology unlock in g_concat_read_metadata
580
		sx_sunlock(&sc->sc_lock_append);
553
		/* Re-read metadata. */
581
		/* Re-read metadata. */
554
		error = g_concat_read_metadata(cp, &md);
582
		error = g_concat_read_metadata(cp, &md);
583
		sx_slock(&sc->sc_lock_append);
584
		// re-compute disk ptr in case sc_disks was reallocated
585
		disk = &sc->sc_disks[no];
586
		
555
		if (error != 0)
587
		if (error != 0)
556
			goto fail;
588
			goto fail;
557
589
Lines 573-581 Link Here
573
	G_CONCAT_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name);
605
	G_CONCAT_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name);
574
606
575
	g_concat_check_and_run(sc);
607
	g_concat_check_and_run(sc);
608
	sx_sunlock(&sc->sc_lock_append); // need lock for check_and_run
576
609
577
	return (0);
610
	return (0);
578
fail:
611
fail:
612
	sx_sunlock(&sc->sc_lock_append);
579
	if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0))
613
	if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0))
580
		g_access(cp, -fcp->acr, -fcp->acw, -fcp->ace);
614
		g_access(cp, -fcp->acr, -fcp->acw, -fcp->ace);
581
	g_detach(cp);
615
	g_detach(cp);
Lines 623-628 Link Here
623
		sc->sc_disks[no].d_consumer = NULL;
657
		sc->sc_disks[no].d_consumer = NULL;
624
	sc->sc_type = type;
658
	sc->sc_type = type;
625
	mtx_init(&sc->sc_lock, "gconcat lock", NULL, MTX_DEF);
659
	mtx_init(&sc->sc_lock, "gconcat lock", NULL, MTX_DEF);
660
	sx_init(&sc->sc_lock_append, "gconcat append lock");
626
661
627
	gp->softc = sc;
662
	gp->softc = sc;
628
	sc->sc_geom = gp;
663
	sc->sc_geom = gp;
Lines 672-677 Link Here
672
	    gp->name));
707
	    gp->name));
673
	free(sc->sc_disks, M_CONCAT);
708
	free(sc->sc_disks, M_CONCAT);
674
	mtx_destroy(&sc->sc_lock);
709
	mtx_destroy(&sc->sc_lock);
710
	sx_destroy(&sc->sc_lock_append);
675
	free(sc, M_CONCAT);
711
	free(sc, M_CONCAT);
676
712
677
	G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name);
713
	G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name);
Lines 947-953 Link Here
947
	}
983
	}
948
}
984
}
949
985
986
static struct g_concat_disk *
987
g_concat_find_disk(struct g_concat_softc *sc, const char *name)
988
{
989
	u_int i;
990
	struct g_concat_disk *disk;
991
992
	sx_assert(&sc->sc_lock_append, SX_LOCKED);
993
	if (strncmp(name, "/dev/", 5) == 0)
994
		name += 5;
995
	for (i = 0; i < sc->sc_ndisks; i++) {
996
		disk = &sc->sc_disks[i];
997
		if (disk->d_consumer == NULL)
998
			continue;
999
		if (disk->d_consumer->provider == NULL)
1000
			continue;
1001
		if (strcmp(disk->d_consumer->provider->name, name) == 0)
1002
			return (disk);
1003
	}
1004
	return (NULL);
1005
}
1006
950
static void
1007
static void
1008
g_concat_ctl_append(struct gctl_req *req, struct g_class *mp)
1009
{
1010
	u_int no, i;
1011
	struct g_concat_softc *sc;
1012
	struct g_provider *pp;
1013
	struct g_consumer *cp, *fcp; // no idea what fcp does
1014
	struct g_geom *gp;
1015
	const char *name, *cname;
1016
	//char param[16];
1017
	struct g_concat_disk *disks_tmp, *disk;
1018
	int *nargs;
1019
	int error;
1020
	int disk_candelete;
1021
	struct g_concat_metadata md;
1022
	u_char *sector;
1023
1024
	g_topology_assert();
1025
1026
	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
1027
	if (nargs == NULL) {
1028
		gctl_error(req, "No '%s' argument.", "nargs");
1029
		return;
1030
	}
1031
	if (*nargs != 2) {
1032
		gctl_error(req, "Invalid number of arguments.");
1033
		return;
1034
	}
1035
1036
	cname = gctl_get_asciiparam(req, "arg0");
1037
	if (cname == NULL) {
1038
		gctl_error(req, "No 'arg%u' argument.", 0);
1039
		return;
1040
	}
1041
	sc = g_concat_find_device(mp, cname);
1042
	if (sc == NULL) {
1043
		gctl_error(req, "No such device: %s.", cname);
1044
		return;
1045
	}
1046
	if (sc->sc_provider == NULL) {
1047
		// this won't race with g_concat_remove_disk as both
1048
		// are holding the topology lock
1049
		gctl_error(req, "Device not active, can't append: %s.", cname);
1050
		return;
1051
	}
1052
	G_CONCAT_DEBUG(1, "Appending to %s:", cname);
1053
	sx_xlock(&sc->sc_lock_append);
1054
	gp = sc->sc_geom;
1055
	fcp = LIST_FIRST(&gp->consumer);
1056
	
1057
	name = gctl_get_asciiparam(req, "arg1");
1058
	if (name == NULL) {
1059
		gctl_error(req, "No 'arg%u' argument.", 1);
1060
		goto fail;
1061
	}
1062
	if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
1063
		name += strlen("/dev/");
1064
	pp = g_provider_by_name(name);
1065
	if (pp == NULL) {
1066
		G_CONCAT_DEBUG(1, "Disk %s is invalid.", name);
1067
		gctl_error(req, "Disk %s is invalid.", name);
1068
		goto fail;
1069
	}
1070
	G_CONCAT_DEBUG(1, "Appending %s to this", name);
1071
	
1072
	if (g_concat_find_disk(sc, name) != NULL) {
1073
		gctl_error(req, "Disk %s already appended.", name);
1074
		goto fail;
1075
	}
1076
	
1077
	// make sure sector size matches
1078
	if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) {
1079
		gctl_error(req, "Providers sectorsize mismatch: %u vs %u",
1080
			   sc->sc_provider->sectorsize, pp->sectorsize);
1081
		goto fail;
1082
	}
1083
	
1084
	cp = g_new_consumer(gp);
1085
	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
1086
	error = g_attach(cp, pp);
1087
	if (error != 0) {
1088
		g_destroy_consumer(cp);
1089
		gctl_error(req, "Cannot open device %s (error=%d).",
1090
			   name, error);
1091
		goto fail;
1092
	}
1093
	
1094
	error = g_access(cp, 1, 0, 0);
1095
	if (error == 0) {
1096
		error = g_getattr("GEOM::candelete", cp, &disk_candelete);
1097
		if (error != 0)
1098
			disk_candelete = 0;
1099
		(void)g_access(cp, -1, 0, 0);
1100
	} else
1101
		G_CONCAT_DEBUG(1, "Failed to access disk %s, error %d.", name, error);
1102
1103
	// invoke g_access exactly as deep as all the other members currently are
1104
	if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0)) {
1105
		error = g_access(cp, fcp->acr, fcp->acw, fcp->ace);
1106
		if (error != 0) {
1107
			g_detach(cp);
1108
			g_destroy_consumer(cp);
1109
			gctl_error(req, "Failed to access disk %s (error=%d).", name, error);
1110
			goto fail;
1111
		}
1112
	}
1113
1114
	disks_tmp = sc->sc_disks;
1115
	sc->sc_disks = malloc(sizeof(struct g_concat_disk) * (sc->sc_ndisks + 1), M_CONCAT, M_WAITOK | M_ZERO);
1116
	memcpy(sc->sc_disks, disks_tmp, sizeof(struct g_concat_disk) * sc->sc_ndisks);
1117
	// fix up disk ptrs of existing consumers
1118
	for (i = 0; i < sc->sc_ndisks; i++) {
1119
		sc->sc_disks[i].d_consumer->private = &sc->sc_disks[i];
1120
	}
1121
	// now it is safe to free the old array
1122
	free(disks_tmp, M_CONCAT);
1123
	disks_tmp = NULL;
1124
	
1125
	disk = &sc->sc_disks[sc->sc_ndisks];
1126
	cp->private = disk;
1127
	disk->d_consumer = cp;
1128
	disk->d_softc = sc;
1129
	disk->d_start = sc->sc_disks[sc->sc_ndisks - 1].d_end;
1130
	disk->d_end = disk->d_start + cp->provider->mediasize;
1131
	disk->d_candelete = disk_candelete;
1132
	disk->d_removed = 0;
1133
	
1134
	sc->sc_ndisks += 1;
1135
1136
	if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) {
1137
		// last sector is for metadata
1138
		disk->d_end -= cp->provider->sectorsize;
1139
1140
		// update metadata on all parts
1141
		strlcpy(md.md_magic, G_CONCAT_MAGIC, sizeof(md.md_magic));
1142
		md.md_version = G_CONCAT_VERSION;
1143
		strlcpy(md.md_name, cname, sizeof(md.md_name));
1144
		md.md_id = sc->sc_id;
1145
		md.md_all = sc->sc_ndisks;
1146
		for (no = 0; no < sc->sc_ndisks; no++) {
1147
			disk = &sc->sc_disks[no];
1148
1149
			md.md_no = no;
1150
			// TODO: implement hardcode? (not sure how, not sure why it even exists)
1151
			bzero(md.md_provider, sizeof(md.md_provider));
1152
			md.md_provsize = disk->d_consumer->provider->mediasize;
1153
			
1154
			pp = disk->d_consumer->provider;
1155
			sector = g_malloc(pp->sectorsize, M_WAITOK);
1156
			
1157
			concat_metadata_encode(&md, sector);
1158
			error = g_access(disk->d_consumer, 0, 1, 0);
1159
			if (error == 0) {
1160
				error = g_write_data(disk->d_consumer, pp->mediasize - pp->sectorsize,
1161
						     sector, pp->sectorsize);
1162
			}
1163
			(void)g_access(disk->d_consumer, 0, -1, 0);
1164
			g_free(sector);
1165
			if (error != 0) {
1166
				gctl_error(req, "Cannot store metadata on %s.", pp->name);
1167
			}
1168
		}
1169
1170
	}
1171
	
1172
	g_resize_provider(sc->sc_provider, disk->d_end);
1173
1174
fail:
1175
	sx_xunlock(&sc->sc_lock_append);
1176
}
1177
1178
static void
951
g_concat_config(struct gctl_req *req, struct g_class *mp, const char *verb)
1179
g_concat_config(struct gctl_req *req, struct g_class *mp, const char *verb)
952
{
1180
{
953
	uint32_t *version;
1181
	uint32_t *version;
Lines 971-976 Link Here
971
	    strcmp(verb, "stop") == 0) {
1199
	    strcmp(verb, "stop") == 0) {
972
		g_concat_ctl_destroy(req, mp);
1200
		g_concat_ctl_destroy(req, mp);
973
		return;
1201
		return;
1202
	} else if (strcmp(verb, "append") == 0) {
1203
		g_concat_ctl_append(req, mp);
1204
		return;
974
	}
1205
	}
975
	gctl_error(req, "Unknown verb.");
1206
	gctl_error(req, "Unknown verb.");
976
}
1207
}
Lines 985-990 Link Here
985
	sc = gp->softc;
1216
	sc = gp->softc;
986
	if (sc == NULL)
1217
	if (sc == NULL)
987
		return;
1218
		return;
1219
1220
	sx_slock(&sc->sc_lock_append);
988
	if (pp != NULL) {
1221
	if (pp != NULL) {
989
		/* Nothing here. */
1222
		/* Nothing here. */
990
	} else if (cp != NULL) {
1223
	} else if (cp != NULL) {
Lines 992-998 Link Here
992
1225
993
		disk = cp->private;
1226
		disk = cp->private;
994
		if (disk == NULL)
1227
		if (disk == NULL)
995
			return;
1228
			goto end;
996
		sbuf_printf(sb, "%s<End>%jd</End>\n", indent,
1229
		sbuf_printf(sb, "%s<End>%jd</End>\n", indent,
997
		    (intmax_t)disk->d_end);
1230
		    (intmax_t)disk->d_end);
998
		sbuf_printf(sb, "%s<Start>%jd</Start>\n", indent,
1231
		sbuf_printf(sb, "%s<Start>%jd</Start>\n", indent,
Lines 1021-1026 Link Here
1021
			sbuf_printf(sb, "DOWN");
1254
			sbuf_printf(sb, "DOWN");
1022
		sbuf_printf(sb, "</State>\n");
1255
		sbuf_printf(sb, "</State>\n");
1023
	}
1256
	}
1257
end:
1258
	sx_sunlock(&sc->sc_lock_append);
1024
}
1259
}
1025
1260
1026
DECLARE_GEOM_CLASS(g_concat_class, g_concat);
1261
DECLARE_GEOM_CLASS(g_concat_class, g_concat);
(-)sys/geom/concat/g_concat.h (-1 / +3 lines)
Lines 42-49 Link Here
42
 * 2 - Added 'stop' command to gconcat(8).
42
 * 2 - Added 'stop' command to gconcat(8).
43
 * 3 - Added md_provider field to metadata and '-h' option to gconcat(8).
43
 * 3 - Added md_provider field to metadata and '-h' option to gconcat(8).
44
 * 4 - Added md_provsize field to metadata.
44
 * 4 - Added md_provsize field to metadata.
45
 * 5 - Added online append functionality ('append' command).
45
 */
46
 */
46
#define	G_CONCAT_VERSION	4
47
#define	G_CONCAT_VERSION	5
47
48
48
#ifdef _KERNEL
49
#ifdef _KERNEL
49
#define	G_CONCAT_TYPE_MANUAL	0
50
#define	G_CONCAT_TYPE_MANUAL	0
Lines 87-92 Link Here
87
	struct g_concat_disk *sc_disks;
88
	struct g_concat_disk *sc_disks;
88
	uint16_t	 sc_ndisks;
89
	uint16_t	 sc_ndisks;
89
	struct mtx	 sc_lock;
90
	struct mtx	 sc_lock;
91
	struct sx	 sc_lock_append; /* controls reallocation of sc_disks */
90
};
92
};
91
#define	sc_name	sc_geom->name
93
#define	sc_name	sc_geom->name
92
#endif	/* _KERNEL */
94
#endif	/* _KERNEL */

Return to bug 235473