From dfb7e6645490f6f86399989e21251baed1f5d2f6 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 6 Jun 2018 15:34:48 +0300 Subject: [PATCH] loader: remove devdesc comments and assertions illumos issue #9583 --- usr/src/boot/sys/boot/common/disk.h | 41 +++++++++++++------------- usr/src/boot/sys/boot/i386/libi386/biosdisk.c | 2 -- usr/src/boot/sys/boot/i386/libi386/libi386.h | 4 +-- usr/src/boot/sys/boot/uboot/lib/libuboot.h | 5 +--- usr/src/boot/sys/boot/userboot/userboot/main.c | 1 - usr/src/boot/sys/boot/zfs/libzfs.h | 9 ++---- 6 files changed, 24 insertions(+), 38 deletions(-) diff --git a/usr/src/boot/sys/boot/common/disk.h b/usr/src/boot/sys/boot/common/disk.h index b833dce2a7..cfdfbf4a95 100644 --- a/usr/src/boot/sys/boot/common/disk.h +++ b/usr/src/boot/sys/boot/common/disk.h @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 2011 Google, Inc. * All rights reserved. * @@ -30,44 +30,44 @@ * * Whole disk access: * - * d_slice = -1 - * d_partition = -1 + * d_slice = -1 + * d_partition = -1 * * Whole MBR slice: * - * d_slice = MBR slice number (typically 1..4) - * d_partition = -1 + * d_slice = MBR slice number (typically 1..4) + * d_partition = -1 * * VTOC disklabel partition within an MBR slice: * - * d_slice = MBR slice number (typically 1..4) - * d_partition = disklabel partition (typically 0..19) + * d_slice = MBR slice number (typically 1..4) + * d_partition = disklabel partition (typically 0..19) * * BSD disklabel partition within an MBR slice: * - * d_slice = MBR slice number (typically 1..4) - * d_partition = disklabel partition (typically 0..19) + * d_slice = MBR slice number (typically 1..4) + * d_partition = disklabel partition (typically 0..19) * * BSD disklabel partition on the true dedicated disk: * - * d_slice = -1 - * d_partition = disklabel partition (typically 0..19) + * d_slice = -1 + * d_partition = disklabel partition (typically 0..19) * * GPT partition: * - * d_slice = GPT partition number (typically 1..N) - * d_partition = 255 + * d_slice = GPT partition number (typically 1..N) + * d_partition = 255 * * For both MBR and GPT, to automatically find the 'best' slice or partition, * set d_slice to zero. This uses the partition type to decide which partition * to use according to the following list of preferences: * - * Solaris2 (active) - * Solaris2 (inactive) - * Linux (active) - * Linux (inactive) - * DOS/Windows (active) - * DOS/Windows (inactive) + * Solaris2 (active) + * Solaris2 (inactive) + * Linux (active) + * Linux (inactive) + * DOS/Windows (active) + * DOS/Windows (inactive) * * Active MBR slices (marked as bootable) are preferred over inactive. GPT * doesn't have the concept of active/inactive partitions. In both MBR and GPT, @@ -84,9 +84,8 @@ #ifndef _DISK_H #define _DISK_H -/* Note: Must match the 'struct devdesc' in stand.h */ struct disk_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ int d_slice; int d_partition; uint64_t d_offset; diff --git a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c index 85899d2045..adc58dda25 100644 --- a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c +++ b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c @@ -49,8 +49,6 @@ #include "disk.h" #include "libi386.h" -CTASSERT(sizeof (struct i386_devdesc) >= sizeof (struct disk_devdesc)); - #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) diff --git a/usr/src/boot/sys/boot/i386/libi386/libi386.h b/usr/src/boot/sys/boot/i386/libi386/libi386.h index a6bd20b5c1..d204311a54 100644 --- a/usr/src/boot/sys/boot/i386/libi386/libi386.h +++ b/usr/src/boot/sys/boot/i386/libi386/libi386.h @@ -30,11 +30,9 @@ /* * i386 fully-qualified device descriptor. - * Note, this must match struct zfs_devdesc for zfs support. */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct i386_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ union { struct { int slice; diff --git a/usr/src/boot/sys/boot/uboot/lib/libuboot.h b/usr/src/boot/sys/boot/uboot/lib/libuboot.h index 4c0d5066bd..ff68dcd87c 100644 --- a/usr/src/boot/sys/boot/uboot/lib/libuboot.h +++ b/usr/src/boot/sys/boot/uboot/lib/libuboot.h @@ -23,13 +23,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct uboot_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ union { struct { int slice; diff --git a/usr/src/boot/sys/boot/userboot/userboot/main.c b/usr/src/boot/sys/boot/userboot/userboot/main.c index dadd473f7a..0b36b3d6ae 100644 --- a/usr/src/boot/sys/boot/userboot/userboot/main.c +++ b/usr/src/boot/sys/boot/userboot/userboot/main.c @@ -152,7 +152,6 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); #if defined(USERBOOT_ZFS_SUPPORT) - CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); if (userboot_zfs_found) { struct zfs_devdesc zdev; diff --git a/usr/src/boot/sys/boot/zfs/libzfs.h b/usr/src/boot/sys/boot/zfs/libzfs.h index 5945b465f8..a8430290f1 100644 --- a/usr/src/boot/sys/boot/zfs/libzfs.h +++ b/usr/src/boot/sys/boot/zfs/libzfs.h @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 2012 Andriy Gapon * All rights reserved. * @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _BOOT_LIBZFS_H_ @@ -33,12 +31,9 @@ /* * ZFS fully-qualified device descriptor. - * Arch-specific device descriptors should be binary compatible with this - * structure if they are to support ZFS. */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct zfs_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ uint64_t pool_guid; uint64_t root_guid; }; -- 2.11.4.GIT