From d21a9b5a6a3b44cc72f8dfae82243e9e94855f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 24 Mar 2022 16:33:40 +0100 Subject: [PATCH] Linux 5.18 compat: replace genhd.h with blkdev.h includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit blkdev.h includes genhd.h since dawn of upstream git, so this is globally safe Upstream-commit: 322cbb50de711814c42fb088f6d31901502c711a ("block: remove genhd.h") Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13251 --- config/kernel-add-disk.m4 | 5 ++--- config/kernel-revalidate-disk-size.m4 | 4 ++-- module/os/linux/zfs/zvol_os.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/kernel-add-disk.m4 b/config/kernel-add-disk.m4 index 5d1779eb4328..44a8a5fd25b6 100644 --- a/config/kernel-add-disk.m4 +++ b/config/kernel-add-disk.m4 @@ -3,16 +3,15 @@ dnl # 5.16 API change dnl # add_disk grew a must-check return code dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [ - ZFS_LINUX_TEST_SRC([add_disk_ret], [ - #include + #include ], [ struct gendisk *disk = NULL; int err = add_disk(disk); err = err; ]) - ]) + AC_DEFUN([ZFS_AC_KERNEL_ADD_DISK], [ AC_MSG_CHECKING([whether add_disk() returns int]) ZFS_LINUX_TEST_RESULT([add_disk_ret], diff --git a/config/kernel-revalidate-disk-size.m4 b/config/kernel-revalidate-disk-size.m4 index a7d0cb3cdab4..13cb92a174e3 100644 --- a/config/kernel-revalidate-disk-size.m4 +++ b/config/kernel-revalidate-disk-size.m4 @@ -8,14 +8,14 @@ dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [ ZFS_LINUX_TEST_SRC([revalidate_disk_size], [ - #include + #include ], [ struct gendisk *disk = NULL; (void) revalidate_disk_size(disk, false); ]) ZFS_LINUX_TEST_SRC([revalidate_disk], [ - #include + #include ], [ struct gendisk *disk = NULL; (void) revalidate_disk(disk); diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index f772f416043e..c964cce0de9a 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -906,7 +906,7 @@ zvol_alloc(dev_t dev, const char *name) if (volmode == ZFS_VOLMODE_DEV) { /* * ZFS_VOLMODE_DEV disable partitioning on ZVOL devices: set - * gendisk->minors = 1 as noted in include/linux/genhd.h. + * gendisk->minors = 1 as noted in include/linux/blkdev.h. * Also disable extended partition numbers (GENHD_FL_EXT_DEVT) * and suppresses partition scanning (GENHD_FL_NO_PART_SCAN) * setting gendisk->flags accordingly.