[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:40:20 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/7c73bb1cf6cc
changeset: 409:7c73bb1cf6cc
user:      ray at terran.dlink.ua
date:      Fri Mar 02 17:21:04 2012 +0200
description:
Update to FreeBSD-HEAD @232391

diffstat:

 head/sys/geom/journal/g_journal.c |  15 ++++-----------
 head/sys/geom/part/g_part.c       |  18 ++++++++++++++----
 head/sys/geom/part/g_part_apm.c   |   4 ++--
 head/sys/geom/part/g_part_ebr.c   |  29 ++++++++++++++++++++---------
 head/sys/geom/part/g_part_mbr.c   |   4 +++-
 5 files changed, 43 insertions(+), 27 deletions(-)

diffs (218 lines):

diff -r 94ee7312d4f7 -r 7c73bb1cf6cc head/sys/geom/journal/g_journal.c
--- a/head/sys/geom/journal/g_journal.c	Fri Mar 02 17:20:40 2012 +0200
+++ b/head/sys/geom/journal/g_journal.c	Fri Mar 02 17:21:04 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/geom/journal/g_journal.c 227309 2011-11-07 15:43:11Z ed $");
+__FBSDID("$FreeBSD: head/sys/geom/journal/g_journal.c 231075 2012-02-06 11:04:36Z kib $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2870,7 +2870,7 @@
 	struct mount *mp;
 	struct bintime bt;
 	char *mountpoint;
-	int error, vfslocked;
+	int error, save, vfslocked;
 
 	DROP_GIANT();
 	g_topology_lock();
@@ -2932,10 +2932,7 @@
 			goto next;
 		}
 
-		MNT_ILOCK(mp);
-		mp->mnt_noasync++;
-		mp->mnt_kern_flag &= ~MNTK_ASYNC;
-		MNT_IUNLOCK(mp);
+		save = curthread_pflags_set(TDP_SYNCIO);
 
 		GJ_TIMER_START(1, &bt);
 		vfs_msync(mp, MNT_NOWAIT);
@@ -2950,11 +2947,7 @@
 			    mountpoint, error);
 		}
 
-		MNT_ILOCK(mp);
-		mp->mnt_noasync--;
-		if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0)
-			mp->mnt_kern_flag |= MNTK_ASYNC;
-		MNT_IUNLOCK(mp);
+		curthread_pflags_restore(save);
 
 		vn_finished_write(mp);
 
diff -r 94ee7312d4f7 -r 7c73bb1cf6cc head/sys/geom/part/g_part.c
--- a/head/sys/geom/part/g_part.c	Fri Mar 02 17:20:40 2012 +0200
+++ b/head/sys/geom/part/g_part.c	Fri Mar 02 17:21:04 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/geom/part/g_part.c 227309 2011-11-07 15:43:11Z ed $");
+__FBSDID("$FreeBSD: head/sys/geom/part/g_part.c 231929 2012-02-20 06:35:52Z ae $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -215,7 +215,7 @@
 				continue;
 			/*
 			 * Prefer a geometry with sectors > 1, but only if
-			 * it doesn't bump down the numbver of heads to 1.
+			 * it doesn't bump down the number of heads to 1.
 			 */
 			if (chs > bestchs || (chs == bestchs && heads > 1 &&
 			    table->gpt_sectors == 1)) {
@@ -1216,6 +1216,9 @@
 
 	if (table->gpt_corrupt) {
 		error = G_PART_RECOVER(table);
+		if (error == 0)
+			error = g_part_check_integrity(table,
+			    LIST_FIRST(&gp->consumer));
 		if (error) {
 			gctl_error(req, "%d recovering '%s' failed",
 			    error, gp->name);
@@ -2054,6 +2057,7 @@
 	struct g_part_table *table;
 	struct g_kerneldump *gkd;
 	struct g_provider *pp;
+	char buf[64];
 
 	pp = bp->bio_to;
 	gp = pp->geom;
@@ -2102,13 +2106,19 @@
 		if (g_handleattr_str(bp, "PART::scheme",
 		    table->gpt_scheme->name))
 			return;
+		if (g_handleattr_str(bp, "PART::type",
+		    G_PART_TYPE(table, entry, buf, sizeof(buf))))
+			return;
 		if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) {
 			/*
 			 * Check that the partition is suitable for kernel
 			 * dumps. Typically only swap partitions should be
-			 * used.
+			 * used. If the request comes from the nested scheme
+			 * we allow dumping there as well.
 			 */
-			if (!G_PART_DUMPTO(table, entry)) {
+			if ((bp->bio_from == NULL ||
+			    bp->bio_from->geom->class != &g_part_class) &&
+			    G_PART_DUMPTO(table, entry) == 0) {
 				g_io_deliver(bp, ENODEV);
 				printf("GEOM_PART: Partition '%s' not suitable"
 				    " for kernel dumps (wrong type?)\n",
diff -r 94ee7312d4f7 -r 7c73bb1cf6cc head/sys/geom/part/g_part_apm.c
--- a/head/sys/geom/part/g_part_apm.c	Fri Mar 02 17:20:40 2012 +0200
+++ b/head/sys/geom/part/g_part_apm.c	Fri Mar 02 17:21:04 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/geom/part/g_part_apm.c 228076 2011-11-28 16:07:26Z ae $");
+__FBSDID("$FreeBSD: head/sys/geom/part/g_part_apm.c 231349 2012-02-10 06:44:30Z ae $");
 
 #include <sys/param.h>
 #include <sys/apm.h>
@@ -102,7 +102,7 @@
 	sizeof(struct g_part_apm_table),
 	.gps_entrysz = sizeof(struct g_part_apm_entry),
 	.gps_minent = 16,
-	.gps_maxent = INT_MAX,
+	.gps_maxent = 4096,
 };
 G_PART_SCHEME_DECLARE(g_part_apm);
 
diff -r 94ee7312d4f7 -r 7c73bb1cf6cc head/sys/geom/part/g_part_ebr.c
--- a/head/sys/geom/part/g_part_ebr.c	Fri Mar 02 17:20:40 2012 +0200
+++ b/head/sys/geom/part/g_part_ebr.c	Fri Mar 02 17:21:04 2012 +0200
@@ -27,7 +27,7 @@
 #include "opt_geom.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/geom/part/g_part_ebr.c 230064 2012-01-13 18:32:56Z truckman $");
+__FBSDID("$FreeBSD: head/sys/geom/part/g_part_ebr.c 231754 2012-02-15 10:33:29Z ae $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -268,7 +268,7 @@
 static int
 g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
 {
-	char psn[8];
+	char type[64];
 	struct g_consumer *cp;
 	struct g_provider *pp;
 	uint32_t msize;
@@ -285,10 +285,15 @@
 	if (basetable->gpt_depth == 0)
 		return (ENXIO);
 	cp = LIST_FIRST(&pp->consumers);
-	error = g_getattr("PART::scheme", cp, &psn);
-	if (error)
+	error = g_getattr("PART::scheme", cp, &type);
+	if (error != 0)
 		return (error);
-	if (strcmp(psn, "MBR"))
+	if (strcmp(type, "MBR") != 0)
+		return (ENXIO);
+	error = g_getattr("PART::type", cp, &type);
+	if (error != 0)
+		return (error);
+	if (strcmp(type, "ebr") != 0)
 		return (ENXIO);
 
 	msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
@@ -405,7 +410,7 @@
 static int
 g_part_ebr_probe(struct g_part_table *table, struct g_consumer *cp)
 {
-	char psn[8];
+	char type[64];
 	struct g_provider *pp;
 	u_char *buf, *p;
 	int error, index, res;
@@ -422,10 +427,16 @@
 	/* Check that we have a parent and that it's a MBR. */
 	if (table->gpt_depth == 0)
 		return (ENXIO);
-	error = g_getattr("PART::scheme", cp, &psn);
-	if (error)
+	error = g_getattr("PART::scheme", cp, &type);
+	if (error != 0)
 		return (error);
-	if (strcmp(psn, "MBR"))
+	if (strcmp(type, "MBR") != 0)
+		return (ENXIO);
+	/* Check that partition has type DOSPTYP_EBR. */
+	error = g_getattr("PART::type", cp, &type);
+	if (error != 0)
+		return (error);
+	if (strcmp(type, "ebr") != 0)
 		return (ENXIO);
 
 	/* Check that there's a EBR. */
diff -r 94ee7312d4f7 -r 7c73bb1cf6cc head/sys/geom/part/g_part_mbr.c
--- a/head/sys/geom/part/g_part_mbr.c	Fri Mar 02 17:20:40 2012 +0200
+++ b/head/sys/geom/part/g_part_mbr.c	Fri Mar 02 17:21:04 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/geom/part/g_part_mbr.c 230522 2012-01-25 03:37:39Z nwhitehorn $");
+__FBSDID("$FreeBSD: head/sys/geom/part/g_part_mbr.c 231928 2012-02-20 05:48:57Z ae $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -119,6 +119,8 @@
 	{ DOSPTYP_EXT,		G_PART_ALIAS_EBR },
 	{ DOSPTYP_NTFS,		G_PART_ALIAS_MS_NTFS },
 	{ DOSPTYP_FAT32,	G_PART_ALIAS_MS_FAT32 },
+	{ DOSPTYP_EXTLBA,	G_PART_ALIAS_EBR },
+	{ DOSPTYP_LDM,		G_PART_ALIAS_MS_LDM_DATA },
 	{ DOSPTYP_LINSWP,	G_PART_ALIAS_LINUX_SWAP },
 	{ DOSPTYP_LINUX,	G_PART_ALIAS_LINUX_DATA },
 	{ DOSPTYP_LINLVM,	G_PART_ALIAS_LINUX_LVM },


More information about the Zrouter-src-freebsd mailing list