Deleted Added
full compact
g_part_gpt.c (172857) g_part_gpt.c (172940)
1/*-
2 * Copyright (c) 2002, 2005, 2006, 2007 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002, 2005, 2006, 2007 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/part/g_part_gpt.c 172857 2007-10-21 20:02:57Z marcel $");
28__FBSDID("$FreeBSD: head/sys/geom/part/g_part_gpt.c 172940 2007-10-24 21:33:00Z jhb $");
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/diskmbr.h>
33#include <sys/endian.h>
34#include <sys/gpt.h>
35#include <sys/kernel.h>
36#include <sys/kobj.h>

--- 79 unchanged lines hidden (view full) ---

116 .gps_entrysz = sizeof(struct g_part_gpt_entry),
117 .gps_minent = 128,
118 .gps_maxent = INT_MAX,
119};
120G_PART_SCHEME_DECLARE(g_part_gpt_scheme);
121
122static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI;
123static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/diskmbr.h>
33#include <sys/endian.h>
34#include <sys/gpt.h>
35#include <sys/kernel.h>
36#include <sys/kobj.h>

--- 79 unchanged lines hidden (view full) ---

116 .gps_entrysz = sizeof(struct g_part_gpt_entry),
117 .gps_minent = 128,
118 .gps_maxent = INT_MAX,
119};
120G_PART_SCHEME_DECLARE(g_part_gpt_scheme);
121
122static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI;
123static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
124static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
124static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
125static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
126static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
127static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
128static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP;
129static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
130static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED;
131

--- 158 unchanged lines hidden (view full) ---

290 *uuid = gpt_uuid_efi;
291 return (0);
292 }
293 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD);
294 if (!strcasecmp(type, alias)) {
295 *uuid = gpt_uuid_freebsd;
296 return (0);
297 }
125static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
126static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
127static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
128static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
129static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP;
130static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
131static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED;
132

--- 158 unchanged lines hidden (view full) ---

291 *uuid = gpt_uuid_efi;
292 return (0);
293 }
294 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD);
295 if (!strcasecmp(type, alias)) {
296 *uuid = gpt_uuid_freebsd;
297 return (0);
298 }
299 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT);
300 if (!strcasecmp(type, alias)) {
301 *uuid = gpt_uuid_freebsd_boot;
302 return (0);
303 }
298 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
299 if (!strcasecmp(type, alias)) {
300 *uuid = gpt_uuid_freebsd_swap;
301 return (0);
302 }
303 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS);
304 if (!strcasecmp(type, alias)) {
305 *uuid = gpt_uuid_freebsd_ufs;

--- 289 unchanged lines hidden (view full) ---

595 struct uuid *type;
596
597 entry = (struct g_part_gpt_entry *)baseentry;
598 type = &entry->ent.ent_type;
599 if (EQUUID(type, &gpt_uuid_efi))
600 return (g_part_alias_name(G_PART_ALIAS_EFI));
601 if (EQUUID(type, &gpt_uuid_freebsd))
602 return (g_part_alias_name(G_PART_ALIAS_FREEBSD));
304 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
305 if (!strcasecmp(type, alias)) {
306 *uuid = gpt_uuid_freebsd_swap;
307 return (0);
308 }
309 alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS);
310 if (!strcasecmp(type, alias)) {
311 *uuid = gpt_uuid_freebsd_ufs;

--- 289 unchanged lines hidden (view full) ---

601 struct uuid *type;
602
603 entry = (struct g_part_gpt_entry *)baseentry;
604 type = &entry->ent.ent_type;
605 if (EQUUID(type, &gpt_uuid_efi))
606 return (g_part_alias_name(G_PART_ALIAS_EFI));
607 if (EQUUID(type, &gpt_uuid_freebsd))
608 return (g_part_alias_name(G_PART_ALIAS_FREEBSD));
609 if (EQUUID(type, &gpt_uuid_freebsd_boot))
610 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT));
603 if (EQUUID(type, &gpt_uuid_freebsd_swap))
604 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
605 if (EQUUID(type, &gpt_uuid_freebsd_ufs))
606 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS));
607 if (EQUUID(type, &gpt_uuid_freebsd_vinum))
608 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
609 if (EQUUID(type, &gpt_uuid_freebsd_zfs))
610 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS));

--- 156 unchanged lines hidden ---
611 if (EQUUID(type, &gpt_uuid_freebsd_swap))
612 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
613 if (EQUUID(type, &gpt_uuid_freebsd_ufs))
614 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS));
615 if (EQUUID(type, &gpt_uuid_freebsd_vinum))
616 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
617 if (EQUUID(type, &gpt_uuid_freebsd_zfs))
618 return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS));

--- 156 unchanged lines hidden ---