Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp635866ybh; Thu, 12 Mar 2020 08:21:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvk3Q6SZqGgnL5QmAi1Xnx6S2B0TdqZr0274Bk9a3IqYLYjRrgjYaDAtVca/oz/93mocQj4 X-Received: by 2002:a4a:a889:: with SMTP id q9mr4446505oom.51.1584026476768; Thu, 12 Mar 2020 08:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584026476; cv=none; d=google.com; s=arc-20160816; b=TfT4KjGbhX8oLX4jECq0YANZDzlevgyuTR8m/UiotWmVzexlXmyAO7/Mw1icOPvPya MboODJjqzzqdTnVnh97BnVSaz/5l5UHRIGxcO9StNnCRvtSRQ0hoGmWSOwp9bqaVL8l4 XPL0rT763cNIMiVIPaucfIw0P37qK7BEzTrtPoEChmL5N1gXcjhZHrIfeP9OUc7DHZz3 X/6aLBsJqP8jZXe5r8uGrH+jK6gi18Fte73LT3gZ/S8zSgXFC/zEBVxZgCK3Shfph1vc ZYgrzgvLdR5/4ZrdeZlQ2+ux4sJrNboX7GS7MJH3U9Z3tSxE+Frlg6BjsBt4BUONM7I3 mM1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lipt5ckcwfM9yooa50sRpcuCHDMWIQlUUAEJOZwYAhk=; b=xnFLvmMwTv6QuF8nyQBYvcoErvXK+3c7DTyYT1EYys7Bk3hUxlaqMN0Qs/UujsW4QF RIWy3rnGXF1DE4PLE5lX3Z+qGWmkdqft7xZAWUBuV4UiZaOKwRTkSNX8bUTd+8ZgvuoW A9z+o0xfE/z+zsglCRzjhmh2Imh2aAnhRliJCZ2JkvlTbk9boWW1+kQ7U0NveHbjVhvC xwQalN1aPNCovt3Mub8Qa81TDNBvrDjSAHa3iduzbCP6tOMx742WMR8UX0YL7uYLmB8h 7hD1RhaSJnnneNq4ne4fqJ0XuSxSbSt2gX/Pxb+Ju6pkhNGDXuwvPi61iXpQpcz5DL85 wSmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YXMbAtj3; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13si2926539otg.2.2020.03.12.08.21.05; Thu, 12 Mar 2020 08:21:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YXMbAtj3; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgCLPUf (ORCPT + 99 others); Thu, 12 Mar 2020 11:20:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38844 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727916AbgCLPUe (ORCPT ); Thu, 12 Mar 2020 11:20:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=lipt5ckcwfM9yooa50sRpcuCHDMWIQlUUAEJOZwYAhk=; b=YXMbAtj3RXevD60KRkT84V64xD bTotOaTlqziCMs1bSDp6gJTqndxqVG8DUhWCg4wRD5GhT2kXtp/joLao4BPxoYZUBhF/X1E2WxtCt rTOcHBs3SamkqrqfgP/beBy+/I3izacgCCyb88mEVy/tiTBSKTVZwpBVHs/ENpRrCHKkzzJwSSz8W 9OCX61nNsTz7lyMvRkLek9pGVjwe502z/m9amJvCjGku+pEfwAYs8V1OQ8Uw4XRS3cDRDQxKBj9T6 KVjVKdg6FfTjYzSJtY+BluptE1CgaV2NZTWpe2rsdD3ACv8cMKuITF6W2m2cL4mrhpK795h7ZZXP5 ijsepTNA==; Received: from [2001:4bb8:184:5cad:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCPdR-0007ze-9v; Thu, 12 Mar 2020 15:20:33 +0000 From: Christoph Hellwig To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ext4@vger.kernel.org, reiserfs-devel@vger.kernel.org Subject: [PATCH 18/21] block: move the *_PARTITION enum out of genhd.h Date: Thu, 12 Mar 2020 16:19:36 +0100 Message-Id: <20200312151939.645254-19-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200312151939.645254-1-hch@lst.de> References: <20200312151939.645254-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The enum containing the *_PARTITION symbolic names is only relevant for the partition parser. More specifically most values are MSDOS partition table system indicators and thus should go straight into msdos.c. One value is only used by the sun partition parser, and the sun and sgi partition parsers use the same value as the x86 Linux RAID indicator to also indicate RAID autodetection. Duplicate them in sun.c and sgi.c given that the different partition types use entirely different values otherwise. Signed-off-by: Christoph Hellwig --- block/partitions/sgi.c | 4 ++++ block/partitions/sun.c | 5 +++++ include/linux/genhd.h | 30 ------------------------------ include/linux/msdos_partition.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/block/partitions/sgi.c b/block/partitions/sgi.c index 927cf501603e..4273f1bb0515 100644 --- a/block/partitions/sgi.c +++ b/block/partitions/sgi.c @@ -9,6 +9,10 @@ #define SGI_LABEL_MAGIC 0x0be5a941 +enum { + LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ +}; + struct sgi_disklabel { __be32 magic_mushroom; /* Big fat spliff... */ __be16 root_part_num; /* Root partition number */ diff --git a/block/partitions/sun.c b/block/partitions/sun.c index 28b44100f2b1..47dc53eccf77 100644 --- a/block/partitions/sun.c +++ b/block/partitions/sun.c @@ -13,6 +13,11 @@ #define SUN_LABEL_MAGIC 0xDABE #define SUN_VTOC_SANITY 0x600DDEEE +enum { + SUN_WHOLE_DISK = 5, + LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ +}; + int sun_partition(struct parsed_partitions *state) { int i; diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 81f21a7ad6f9..df809e91ad99 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -30,36 +30,6 @@ extern struct device_type part_type; extern struct kobject *block_depr; extern struct class block_class; -enum { -/* These three have identical behaviour; use the second one if DOS FDISK gets - confused about extended/logical partitions starting past cylinder 1023. */ - DOS_EXTENDED_PARTITION = 5, - LINUX_EXTENDED_PARTITION = 0x85, - WIN98_EXTENDED_PARTITION = 0x0f, - - SUN_WHOLE_DISK = DOS_EXTENDED_PARTITION, - - 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, - NEW_SOLARIS_X86_PARTITION = 0xbf, - - DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */ - DM6_AUX3PARTITION = 0x53, /* no DDO: use xlated geom */ - DM6_PARTITION = 0x54, /* has DDO: use xlated geom & offset */ - EZD_PARTITION = 0x55, /* EZ-DRIVE */ - - FREEBSD_PARTITION = 0xa5, /* FreeBSD Partition ID */ - OPENBSD_PARTITION = 0xa6, /* OpenBSD Partition ID */ - NETBSD_PARTITION = 0xa9, /* NetBSD Partition ID */ - BSDI_PARTITION = 0xb7, /* BSDI Partition ID */ - MINIX_PARTITION = 0x81, /* Minix Partition ID */ - UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ -}; - #define DISK_MAX_PARTS 256 #define DISK_NAME_LEN 32 diff --git a/include/linux/msdos_partition.h b/include/linux/msdos_partition.h index a8e2c1b4bc66..e151af072cd1 100644 --- a/include/linux/msdos_partition.h +++ b/include/linux/msdos_partition.h @@ -17,4 +17,35 @@ struct msdos_partition { __le32 nr_sects; /* nr of sectors in partition */ } __packed; +enum msdos_sys_ind { + /* + * These three have identical behaviour; use the second one if DOS FDISK + * gets confused about extended/logical partitions starting past + * cylinder 1023. + */ + DOS_EXTENDED_PARTITION = 5, + 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, + NEW_SOLARIS_X86_PARTITION = 0xbf, + + DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */ + DM6_AUX3PARTITION = 0x53, /* no DDO: use xlated geom */ + DM6_PARTITION = 0x54, /* has DDO: use xlated geom & offset */ + EZD_PARTITION = 0x55, /* EZ-DRIVE */ + + FREEBSD_PARTITION = 0xa5, /* FreeBSD Partition ID */ + OPENBSD_PARTITION = 0xa6, /* OpenBSD Partition ID */ + NETBSD_PARTITION = 0xa9, /* NetBSD Partition ID */ + BSDI_PARTITION = 0xb7, /* BSDI Partition ID */ + MINIX_PARTITION = 0x81, /* Minix Partition ID */ + UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ +}; + #endif /* LINUX_MSDOS_PARTITION_H */ -- 2.24.1