Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

partitions/msdos: remove LINUX_SWAP_PARTITION

Just always use NEW_SOLARIS_X86_PARTITION and explain the situation,
as that is less confusing than two names for a single value.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
cb0ab526 0226e9ea

+13 -8
+12 -6
block/partitions/msdos.c
··· 77 77 p[2] == AIX_LABEL_MAGIC3 && 78 78 p[3] == AIX_LABEL_MAGIC4)) 79 79 return 0; 80 - /* Assume the partition table is valid if Linux partitions exists */ 80 + 81 + /* 82 + * Assume the partition table is valid if Linux partitions exists. 83 + * Note that old Solaris/x86 partitions use the same indicator as 84 + * Linux swap partitions, so we consider that a Linux partition as 85 + * well. 86 + */ 81 87 for (slot = 1; slot <= 4; slot++, pt++) { 82 - if (pt->sys_ind == LINUX_SWAP_PARTITION || 83 - pt->sys_ind == LINUX_RAID_PARTITION || 84 - pt->sys_ind == LINUX_DATA_PARTITION || 85 - pt->sys_ind == LINUX_LVM_PARTITION || 86 - is_extended_partition(pt)) 88 + if (pt->sys_ind == SOLARIS_X86_PARTITION || 89 + pt->sys_ind == LINUX_RAID_PARTITION || 90 + pt->sys_ind == LINUX_DATA_PARTITION || 91 + pt->sys_ind == LINUX_LVM_PARTITION || 92 + is_extended_partition(pt)) 87 93 return 0; 88 94 } 89 95 d = read_part_sector(state, 7, &sect);
+1 -2
include/linux/msdos_partition.h
··· 27 27 LINUX_EXTENDED_PARTITION = 0x85, 28 28 WIN98_EXTENDED_PARTITION = 0x0f, 29 29 30 - LINUX_SWAP_PARTITION = 0x82, 31 30 LINUX_DATA_PARTITION = 0x83, 32 31 LINUX_LVM_PARTITION = 0x8e, 33 32 LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ 34 33 35 - SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, 34 + SOLARIS_X86_PARTITION = 0x82, /* also Linux swap partitions */ 36 35 NEW_SOLARIS_X86_PARTITION = 0xbf, 37 36 38 37 DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */