summaryrefslogtreecommitdiff
path: root/block/partitions/msdos.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-03-24 08:25:28 +0100
committerJens Axboe <axboe@kernel.dk>2020-03-24 07:57:08 -0600
commitcb0ab52652123c47cb72e665ce9fdd3029dcb175 (patch)
tree541e7e6d6105ae48740113ef8b2ba758946d3317 /block/partitions/msdos.c
parent0226e9ead44b2eb8f2471d24e0b0c5ff60bc322c (diff)
downloadlwn-cb0ab52652123c47cb72e665ce9fdd3029dcb175.tar.gz
lwn-cb0ab52652123c47cb72e665ce9fdd3029dcb175.zip
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>
Diffstat (limited to 'block/partitions/msdos.c')
-rw-r--r--block/partitions/msdos.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c
index 88ee5ee7f442..e44e2f0a02cc 100644
--- a/block/partitions/msdos.c
+++ b/block/partitions/msdos.c
@@ -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);