Skip to content

Commit

Permalink
partitions/msdos: remove LINUX_SWAP_PARTITION
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Mar 24, 2020
1 parent 0226e9e commit cb0ab52
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 12 additions & 6 deletions block/partitions/msdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@ static int aix_magic_present(struct parsed_partitions *state, unsigned char *p)
p[2] == AIX_LABEL_MAGIC3 &&
p[3] == AIX_LABEL_MAGIC4))
return 0;
/* Assume the partition table is valid if Linux partitions exists */

/*
* Assume the partition table is valid if Linux partitions exists.
* Note that old Solaris/x86 partitions use the same indicator as
* Linux swap partitions, so we consider that a Linux partition as
* well.
*/
for (slot = 1; slot <= 4; slot++, pt++) {
if (pt->sys_ind == LINUX_SWAP_PARTITION ||
pt->sys_ind == LINUX_RAID_PARTITION ||
pt->sys_ind == LINUX_DATA_PARTITION ||
pt->sys_ind == LINUX_LVM_PARTITION ||
is_extended_partition(pt))
if (pt->sys_ind == SOLARIS_X86_PARTITION ||
pt->sys_ind == LINUX_RAID_PARTITION ||
pt->sys_ind == LINUX_DATA_PARTITION ||
pt->sys_ind == LINUX_LVM_PARTITION ||
is_extended_partition(pt))
return 0;
}
d = read_part_sector(state, 7, &sect);
Expand Down
3 changes: 1 addition & 2 deletions include/linux/msdos_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ enum msdos_sys_ind {
LINUX_EXTENDED_PARTITION = 0x85,
WIN98_EXTENDED_PARTITION = 0x0f,

LINUX_SWAP_PARTITION = 0x82,
LINUX_DATA_PARTITION = 0x83,
LINUX_LVM_PARTITION = 0x8e,
LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */

SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
SOLARIS_X86_PARTITION = 0x82, /* also Linux swap partitions */
NEW_SOLARIS_X86_PARTITION = 0xbf,

DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */
Expand Down

0 comments on commit cb0ab52

Please sign in to comment.