diff options
author | marcel <marcel@FreeBSD.org> | 2007-10-21 20:02:57 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-10-21 20:02:57 +0000 |
commit | 96e4f348f468fc0ebb50aaa987df88acd8f5712f (patch) | |
tree | c164ca46d230590829379c1942c1c6b70335c255 | |
parent | 69e9c2d1b9a3bf7997c2e229472397cc326fdf10 (diff) | |
download | FreeBSD-src-96e4f348f468fc0ebb50aaa987df88acd8f5712f.zip FreeBSD-src-96e4f348f468fc0ebb50aaa987df88acd8f5712f.tar.gz |
Add the freebsd-zfs alias. Both APM and GPT have ZFS partition
types.
-rw-r--r-- | sys/geom/part/g_part.c | 1 | ||||
-rw-r--r-- | sys/geom/part/g_part.h | 1 | ||||
-rw-r--r-- | sys/geom/part/g_part_apm.c | 7 | ||||
-rw-r--r-- | sys/geom/part/g_part_gpt.c | 8 |
4 files changed, 17 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 9748d6f..0a35f6a 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -69,6 +69,7 @@ struct g_part_alias_list { { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, + { "freebsd-zfs", G_PART_ALIAS_FREEBSD_ZFS }, { "mbr", G_PART_ALIAS_MBR } }; diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index 08be641..01bf65f 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -41,6 +41,7 @@ enum g_part_alias { 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. */ + G_PART_ALIAS_FREEBSD_ZFS, /* A ZFS file system entry. */ G_PART_ALIAS_MBR, /* A MBR (extended) partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c index 8b2fbc8..12746e3 100644 --- a/sys/geom/part/g_part_apm.c +++ b/sys/geom/part/g_part_apm.c @@ -131,6 +131,11 @@ apm_parse_type(const char *type, char *buf, size_t bufsz) strcpy(buf, APM_ENT_TYPE_FREEBSD_VINUM); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_ZFS); + return (0); + } return (EINVAL); } @@ -358,6 +363,8 @@ g_part_apm_type(struct g_part_table *basetable, struct g_part_entry *baseentry, return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_VINUM)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_ZFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS)); buf[0] = '!'; len = MIN(sizeof(entry->ent.ent_type), bufsz - 2); bcopy(type, buf + 1, len); diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index c3072bc..140c91a 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -124,6 +124,7 @@ static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; 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; +static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; @@ -309,6 +310,11 @@ gpt_parse_type(const char *type, struct uuid *uuid) *uuid = gpt_uuid_freebsd_vinum; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); + if (!strcasecmp(type, alias)) { + *uuid = gpt_uuid_freebsd_zfs; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_MBR); if (!strcasecmp(type, alias)) { *uuid = gpt_uuid_mbr; @@ -600,6 +606,8 @@ g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry, return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS)); if (EQUUID(type, &gpt_uuid_freebsd_vinum)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM)); + if (EQUUID(type, &gpt_uuid_freebsd_zfs)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS)); if (EQUUID(type, &gpt_uuid_mbr)) return (g_part_alias_name(G_PART_ALIAS_MBR)); buf[0] = '!'; |