Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Nov 2012 16:13:36 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r243237 - in stable/9/sys: geom/part sys
Message-ID:  <201211181613.qAIGDaEu061683@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sun Nov 18 16:13:36 2012
New Revision: 243237
URL: http://svnweb.freebsd.org/changeset/base/243237

Log:
  MFC r236023 (by marcel):
    Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
    The gpart alias for these partition types is "freebsd-nandfs".

Modified:
  stable/9/sys/geom/part/g_part.c
  stable/9/sys/geom/part/g_part.h
  stable/9/sys/geom/part/g_part_apm.c
  stable/9/sys/geom/part/g_part_bsd.c
  stable/9/sys/geom/part/g_part_gpt.c
  stable/9/sys/geom/part/g_part_vtoc8.c
  stable/9/sys/sys/apm.h
  stable/9/sys/sys/disklabel.h
  stable/9/sys/sys/gpt.h
  stable/9/sys/sys/vtoc.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/part/g_part.c
==============================================================================
--- stable/9/sys/geom/part/g_part.c	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part.c	Sun Nov 18 16:13:36 2012	(r243237)
@@ -83,6 +83,7 @@ struct g_part_alias_list {
 	{ "fat32", G_PART_ALIAS_MS_FAT32 },
 	{ "freebsd", G_PART_ALIAS_FREEBSD },
 	{ "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT },
+	{ "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS },
 	{ "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP },
 	{ "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS },
 	{ "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM },

Modified: stable/9/sys/geom/part/g_part.h
==============================================================================
--- stable/9/sys/geom/part/g_part.h	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part.h	Sun Nov 18 16:13:36 2012	(r243237)
@@ -46,6 +46,7 @@ enum g_part_alias {
 	G_PART_ALIAS_EFI,		/* A EFI system partition entry. */
 	G_PART_ALIAS_FREEBSD,		/* A BSD labeled partition entry. */
 	G_PART_ALIAS_FREEBSD_BOOT,	/* A FreeBSD boot partition entry. */
+	G_PART_ALIAS_FREEBSD_NANDFS,	/* A FreeBSD nandfs partition entry. */
 	G_PART_ALIAS_FREEBSD_SWAP,	/* A swap partition entry. */
 	G_PART_ALIAS_FREEBSD_UFS,	/* A UFS/UFS2 file system entry. */
 	G_PART_ALIAS_FREEBSD_VINUM,	/* A Vinum partition entry. */

Modified: stable/9/sys/geom/part/g_part_apm.c
==============================================================================
--- stable/9/sys/geom/part/g_part_apm.c	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part_apm.c	Sun Nov 18 16:13:36 2012	(r243237)
@@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b
 		strcpy(buf, APM_ENT_TYPE_FREEBSD);
 		return (0);
 	}
+	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
+	if (!strcasecmp(type, alias)) {
+		strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS);
+		return (0);
+	}
 	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
 	if (!strcasecmp(type, alias)) {
 		strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP);
@@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas
 		return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS));
 	if (!strcmp(type, APM_ENT_TYPE_FREEBSD))
 		return (g_part_alias_name(G_PART_ALIAS_FREEBSD));
+	if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS))
+		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS));
 	if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP))
 		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
 	if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS))

Modified: stable/9/sys/geom/part/g_part_bsd.c
==============================================================================
--- stable/9/sys/geom/part/g_part_bsd.c	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part_bsd.c	Sun Nov 18 16:13:36 2012	(r243237)
@@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t
 		*fstype = (u_int)lt;
 		return (0);
 	}
+	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
+	if (!strcasecmp(type, alias)) {
+		*fstype = FS_NANDFS;
+		return (0);
+	}
 	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
 	if (!strcasecmp(type, alias)) {
 		*fstype = FS_SWAP;
@@ -457,6 +462,8 @@ g_part_bsd_type(struct g_part_table *bas
 
 	entry = (struct g_part_bsd_entry *)baseentry;
 	type = entry->part.p_fstype;
+	if (type == FS_NANDFS)
+		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS));
 	if (type == FS_SWAP)
 		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
 	if (type == FS_BSDFFS)

Modified: stable/9/sys/geom/part/g_part_gpt.c
==============================================================================
--- stable/9/sys/geom/part/g_part_gpt.c	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part_gpt.c	Sun Nov 18 16:13:36 2012	(r243237)
@@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = 
 static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI;
 static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
 static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
+static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS;
 static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
 static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
 static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
@@ -195,6 +196,7 @@ static struct g_part_uuid_alias {
 	{ &gpt_uuid_efi, 		G_PART_ALIAS_EFI,		 0xee },
 	{ &gpt_uuid_freebsd,		G_PART_ALIAS_FREEBSD,		 0xa5 },
 	{ &gpt_uuid_freebsd_boot, 	G_PART_ALIAS_FREEBSD_BOOT,	 0 },
+	{ &gpt_uuid_freebsd_nandfs, 	G_PART_ALIAS_FREEBSD_NANDFS,	 0 },
 	{ &gpt_uuid_freebsd_swap,	G_PART_ALIAS_FREEBSD_SWAP,	 0 },
 	{ &gpt_uuid_freebsd_ufs,	G_PART_ALIAS_FREEBSD_UFS,	 0 },
 	{ &gpt_uuid_freebsd_vinum,	G_PART_ALIAS_FREEBSD_VINUM,	 0 },

Modified: stable/9/sys/geom/part/g_part_vtoc8.c
==============================================================================
--- stable/9/sys/geom/part/g_part_vtoc8.c	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/geom/part/g_part_vtoc8.c	Sun Nov 18 16:13:36 2012	(r243237)
@@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1
 		*tag = (uint16_t)lt;
 		return (0);
 	}
+	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
+	if (!strcasecmp(type, alias)) {
+		*tag = VTOC_TAG_FREEBSD_NANDFS;
+		return (0);
+	}
 	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
 	if (!strcasecmp(type, alias)) {
 		*tag = VTOC_TAG_FREEBSD_SWAP;
@@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b
 
 	table = (struct g_part_vtoc8_table *)basetable;
 	tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag);
+	if (tag == VTOC_TAG_FREEBSD_NANDFS)
+		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS));
 	if (tag == VTOC_TAG_FREEBSD_SWAP)
 		return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
 	if (tag == VTOC_TAG_FREEBSD_UFS)

Modified: stable/9/sys/sys/apm.h
==============================================================================
--- stable/9/sys/sys/apm.h	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/sys/apm.h	Sun Nov 18 16:13:36 2012	(r243237)
@@ -56,6 +56,7 @@ struct apm_ent {
 #define	APM_ENT_TYPE_UNUSED		"Apple_Free"
 
 #define	APM_ENT_TYPE_FREEBSD		"FreeBSD"
+#define	APM_ENT_TYPE_FREEBSD_NANDFS	"FreeBSD-nandfs"
 #define	APM_ENT_TYPE_FREEBSD_SWAP	"FreeBSD-swap"
 #define	APM_ENT_TYPE_FREEBSD_UFS	"FreeBSD-UFS"
 #define	APM_ENT_TYPE_FREEBSD_VINUM	"FreeBSD-Vinum"

Modified: stable/9/sys/sys/disklabel.h
==============================================================================
--- stable/9/sys/sys/disklabel.h	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/sys/disklabel.h	Sun Nov 18 16:13:36 2012	(r243237)
@@ -232,6 +232,7 @@ static const char *dktypenames[] = {
 #define	FS_UDF		24		/* UDF */
 #define	FS_EFS		26		/* SGI's Extent File system */
 #define	FS_ZFS		27		/* Sun's ZFS */
+#define	FS_NANDFS	30		/* FreeBSD nandfs (NiLFS derived) */
 
 #ifdef	FSTYPENAMES
 static const char *fstypenames[] = {
@@ -263,6 +264,9 @@ static const char *fstypenames[] = {
 	"?",
 	"EFS",
 	"ZFS",
+	"?",
+	"?",
+	"nandfs",
 	NULL
 };
 #define FSMAXTYPES	(sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)

Modified: stable/9/sys/sys/gpt.h
==============================================================================
--- stable/9/sys/sys/gpt.h	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/sys/gpt.h	Sun Nov 18 16:13:36 2012	(r243237)
@@ -79,6 +79,10 @@ struct gpt_ent {
 	{0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}}
 #define	GPT_ENT_TYPE_FREEBSD		\
 	{0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
+#define	GPT_ENT_TYPE_FREEBSD_BOOT	\
+	{0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}}
+#define	GPT_ENT_TYPE_FREEBSD_NANDFS	\
+	{0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}}
 #define	GPT_ENT_TYPE_FREEBSD_SWAP	\
 	{0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 #define	GPT_ENT_TYPE_FREEBSD_UFS	\
@@ -87,8 +91,6 @@ struct gpt_ent {
 	{0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 #define	GPT_ENT_TYPE_FREEBSD_ZFS	\
 	{0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
-#define	GPT_ENT_TYPE_FREEBSD_BOOT	\
-	{0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}}
 
 /*
  * The following are unused but documented here to avoid reuse.

Modified: stable/9/sys/sys/vtoc.h
==============================================================================
--- stable/9/sys/sys/vtoc.h	Sun Nov 18 16:07:53 2012	(r243236)
+++ stable/9/sys/sys/vtoc.h	Sun Nov 18 16:13:36 2012	(r243237)
@@ -51,6 +51,7 @@
 #define	VTOC_TAG_FREEBSD_UFS	0x0902
 #define	VTOC_TAG_FREEBSD_VINUM	0x0903
 #define	VTOC_TAG_FREEBSD_ZFS	0x0904
+#define	VTOC_TAG_FREEBSD_NANDFS	0x0905
 
 #define	VTOC_FLAG_UNMNT		0x01	/* unmountable partition */
 #define	VTOC_FLAG_RDONLY	0x10    /* partition is read/only */



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