g_part_gpt.c (267156) | g_part_gpt.c (268091) |
---|---|
1/*- 2 * Copyright (c) 2002, 2005-2007, 2011 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-2007, 2011 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: stable/10/sys/geom/part/g_part_gpt.c 267156 2014-06-06 12:37:56Z ae $"); | 28__FBSDID("$FreeBSD: stable/10/sys/geom/part/g_part_gpt.c 268091 2014-07-01 13:29:17Z ae $"); |
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> --- 139 unchanged lines hidden (view full) --- 176static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; 177static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; 178static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; 179static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; 180static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; 181static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; 182static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; 183static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; | 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> --- 139 unchanged lines hidden (view full) --- 176static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; 177static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; 178static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; 179static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; 180static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; 181static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; 182static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; 183static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; |
184static struct uuid gpt_uuid_dfbsd_swap = GPT_ENT_TYPE_DRAGONFLY_SWAP; 185static struct uuid gpt_uuid_dfbsd_ufs1 = GPT_ENT_TYPE_DRAGONFLY_UFS1; 186static struct uuid gpt_uuid_dfbsd_vinum = GPT_ENT_TYPE_DRAGONFLY_VINUM; 187static struct uuid gpt_uuid_dfbsd_ccd = GPT_ENT_TYPE_DRAGONFLY_CCD; 188static struct uuid gpt_uuid_dfbsd_legacy = GPT_ENT_TYPE_DRAGONFLY_LEGACY; 189static struct uuid gpt_uuid_dfbsd_hammer = GPT_ENT_TYPE_DRAGONFLY_HAMMER; 190static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; 191static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32; 192static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64; |
|
184 185static struct g_part_uuid_alias { 186 struct uuid *uuid; 187 int alias; 188 int mbrtype; 189} gpt_uuid_alias_match[] = { 190 { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, 191 { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, --- 25 unchanged lines hidden (view full) --- 217 { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA, 0 }, 218 { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED, 0 }, 219 { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD, 0 }, 220 { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD, 0 }, 221 { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS, 0 }, 222 { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS, 0 }, 223 { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID, 0 }, 224 { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP, 0 }, | 193 194static struct g_part_uuid_alias { 195 struct uuid *uuid; 196 int alias; 197 int mbrtype; 198} gpt_uuid_alias_match[] = { 199 { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, 200 { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, --- 25 unchanged lines hidden (view full) --- 226 { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA, 0 }, 227 { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED, 0 }, 228 { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD, 0 }, 229 { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD, 0 }, 230 { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS, 0 }, 231 { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS, 0 }, 232 { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID, 0 }, 233 { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP, 0 }, |
234 { &gpt_uuid_dfbsd_swap, G_PART_ALIAS_DFBSD_SWAP, 0 }, 235 { &gpt_uuid_dfbsd_ufs1, G_PART_ALIAS_DFBSD_UFS, 0 }, 236 { &gpt_uuid_dfbsd_vinum, G_PART_ALIAS_DFBSD_VINUM, 0 }, 237 { &gpt_uuid_dfbsd_ccd, G_PART_ALIAS_DFBSD_CCD, 0 }, 238 { &gpt_uuid_dfbsd_legacy, G_PART_ALIAS_DFBSD_LEGACY, 0 }, 239 { &gpt_uuid_dfbsd_hammer, G_PART_ALIAS_DFBSD_HAMMER, 0 }, 240 { &gpt_uuid_dfbsd_hammer2, G_PART_ALIAS_DFBSD_HAMMER2, 0 }, 241 { &gpt_uuid_dfbsd_label32, G_PART_ALIAS_DFBSD, 0xa5 }, 242 { &gpt_uuid_dfbsd_label64, G_PART_ALIAS_DFBSD64, 0xa5 }, |
|
225 { NULL, 0, 0 } 226}; 227 228static int 229gpt_write_mbr_entry(u_char *mbr, int idx, int typ, quad_t start, 230 quad_t end) 231{ 232 --- 468 unchanged lines hidden (view full) --- 701 702static int 703g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) 704{ 705 struct g_part_gpt_entry *entry; 706 707 entry = (struct g_part_gpt_entry *)baseentry; 708 return ((EQUUID(&entry->ent.ent_type, &gpt_uuid_freebsd_swap) || | 243 { NULL, 0, 0 } 244}; 245 246static int 247gpt_write_mbr_entry(u_char *mbr, int idx, int typ, quad_t start, 248 quad_t end) 249{ 250 --- 468 unchanged lines hidden (view full) --- 719 720static int 721g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) 722{ 723 struct g_part_gpt_entry *entry; 724 725 entry = (struct g_part_gpt_entry *)baseentry; 726 return ((EQUUID(&entry->ent.ent_type, &gpt_uuid_freebsd_swap) || |
709 EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap)) ? 1 : 0); | 727 EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap) || 728 EQUUID(&entry->ent.ent_type, &gpt_uuid_dfbsd_swap)) ? 1 : 0); |
710} 711 712static int 713g_part_gpt_modify(struct g_part_table *basetable, 714 struct g_part_entry *baseentry, struct g_part_parms *gpp) 715{ 716 struct g_part_gpt_entry *entry; 717 int error; --- 597 unchanged lines hidden --- | 729} 730 731static int 732g_part_gpt_modify(struct g_part_table *basetable, 733 struct g_part_entry *baseentry, struct g_part_parms *gpp) 734{ 735 struct g_part_gpt_entry *entry; 736 int error; --- 597 unchanged lines hidden --- |