Linux 5.18 compat: replace genhd.h with blkdev.h includes

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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13251
This commit is contained in:
наб 2022-03-24 16:33:40 +01:00 committed by Brian Behlendorf
parent 215a8255a9
commit 9f7f704507
3 changed files with 5 additions and 6 deletions

View File

@ -3,16 +3,15 @@ dnl # 5.16 API change
dnl # add_disk grew a must-check return code dnl # add_disk grew a must-check return code
dnl # dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [ AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [
ZFS_LINUX_TEST_SRC([add_disk_ret], [ ZFS_LINUX_TEST_SRC([add_disk_ret], [
#include <linux/genhd.h> #include <linux/blkdev.h>
], [ ], [
struct gendisk *disk = NULL; struct gendisk *disk = NULL;
int err = add_disk(disk); int err = add_disk(disk);
err = err; err = err;
]) ])
]) ])
AC_DEFUN([ZFS_AC_KERNEL_ADD_DISK], [ AC_DEFUN([ZFS_AC_KERNEL_ADD_DISK], [
AC_MSG_CHECKING([whether add_disk() returns int]) AC_MSG_CHECKING([whether add_disk() returns int])
ZFS_LINUX_TEST_RESULT([add_disk_ret], ZFS_LINUX_TEST_RESULT([add_disk_ret],

View File

@ -8,14 +8,14 @@ dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [ AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [ ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
#include <linux/genhd.h> #include <linux/blkdev.h>
], [ ], [
struct gendisk *disk = NULL; struct gendisk *disk = NULL;
(void) revalidate_disk_size(disk, false); (void) revalidate_disk_size(disk, false);
]) ])
ZFS_LINUX_TEST_SRC([revalidate_disk], [ ZFS_LINUX_TEST_SRC([revalidate_disk], [
#include <linux/genhd.h> #include <linux/blkdev.h>
], [ ], [
struct gendisk *disk = NULL; struct gendisk *disk = NULL;
(void) revalidate_disk(disk); (void) revalidate_disk(disk);

View File

@ -906,7 +906,7 @@ zvol_alloc(dev_t dev, const char *name)
if (volmode == ZFS_VOLMODE_DEV) { if (volmode == ZFS_VOLMODE_DEV) {
/* /*
* ZFS_VOLMODE_DEV disable partitioning on ZVOL devices: set * 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) * Also disable extended partition numbers (GENHD_FL_EXT_DEVT)
* and suppresses partition scanning (GENHD_FL_NO_PART_SCAN) * and suppresses partition scanning (GENHD_FL_NO_PART_SCAN)
* setting gendisk->flags accordingly. * setting gendisk->flags accordingly.