From e1c720de7d1abb7c0f2f4b685fe8c1906bb8060a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Tue, 18 Jan 2022 23:40:43 +0100 Subject: [PATCH] libefi: remove efi_type() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All it is right now is some #if 0ed Solaris code that returns ENOSYS, and is only applicable for the Solaris blockdev layer. In the Illumos gate, there's a single user: rmformat(1); I recommend a read of the manual as a blast from the past, but, well Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Issue #12844 Closes #12969 --- include/sys/efi_partition.h | 1 - lib/libefi/rdwr_efi.c | 28 ---------------------------- lib/libzfs/libzfs.abi | 5 ----- 3 files changed, 34 deletions(-) diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index cda2c98e5d..af3e98a079 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -369,7 +369,6 @@ _SYS_EFI_PARTITION_H int efi_alloc_and_read(int, struct dk_gpt **); _SYS_EFI_PARTITION_H int efi_write(int, struct dk_gpt *); _SYS_EFI_PARTITION_H int efi_rescan(int); _SYS_EFI_PARTITION_H void efi_free(struct dk_gpt *); -_SYS_EFI_PARTITION_H int efi_type(int); _SYS_EFI_PARTITION_H void efi_err_check(struct dk_gpt *); _SYS_EFI_PARTITION_H int efi_use_whole_disk(int fd); #endif diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c index 6acfdc5e1f..b4fec0c860 100644 --- a/lib/libefi/rdwr_efi.c +++ b/lib/libefi/rdwr_efi.c @@ -1541,34 +1541,6 @@ efi_free(struct dk_gpt *ptr) free(ptr); } -/* - * Input: File descriptor - * Output: 1 if disk has an EFI label, or > 2TB with no VTOC or legacy MBR. - * Otherwise 0. - */ -int -efi_type(int fd) -{ -#if 0 - struct vtoc vtoc; - struct extvtoc extvtoc; - - if (ioctl(fd, DKIOCGEXTVTOC, &extvtoc) == -1) { - if (errno == ENOTSUP) - return (1); - else if (errno == ENOTTY) { - if (ioctl(fd, DKIOCGVTOC, &vtoc) == -1) - if (errno == ENOTSUP) - return (1); - } - } - return (0); -#else - (void) fd; - return (ENOSYS); -#endif -} - void efi_err_check(struct dk_gpt *vtoc) { diff --git a/lib/libzfs/libzfs.abi b/lib/libzfs/libzfs.abi index b682f4f709..122321103f 100644 --- a/lib/libzfs/libzfs.abi +++ b/lib/libzfs/libzfs.abi @@ -165,7 +165,6 @@ - @@ -841,10 +840,6 @@ - - - -