Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 10:02:20 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231751 - head/sys/geom/part
Message-ID:  <201202151002.q1FA2KPH048621@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Feb 15 10:02:19 2012
New Revision: 231751
URL: http://svn.freebsd.org/changeset/base/231751

Log:
  Add PART::type attribute handler. It returns partition type as string.
  
  MFC after:	2 weeks

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Wed Feb 15 09:53:20 2012	(r231750)
+++ head/sys/geom/part/g_part.c	Wed Feb 15 10:02:19 2012	(r231751)
@@ -2057,6 +2057,7 @@ g_part_start(struct bio *bp)
 	struct g_part_table *table;
 	struct g_kerneldump *gkd;
 	struct g_provider *pp;
+	char buf[64];
 
 	pp = bp->bio_to;
 	gp = pp->geom;
@@ -2105,6 +2106,9 @@ g_part_start(struct bio *bp)
 		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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202151002.q1FA2KPH048621>