Linux 6.9 compat: blk_alloc_disk takes 2 args
Now, it takes queue limits, this is a trivial implementation with no queue limits, implementing proper queue limits is left as an exercise to the reader. Signed-off-by: Ryan Lahfa <ryan@lahfa.xyz>
This commit is contained in:
parent
08f57a3150
commit
980aca470c
|
@ -50,6 +50,13 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
||||||
disk = blk_alloc_disk(NUMA_NO_NODE);
|
disk = blk_alloc_disk(NUMA_NO_NODE);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([blk_alloc_disk_2args], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
],[
|
||||||
|
struct gendisk *disk __attribute__ ((unused));
|
||||||
|
disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
|
ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
|
@ -71,30 +78,45 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
||||||
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
||||||
[submit_bio is member of struct block_device_operations])
|
[submit_bio is member of struct block_device_operations])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl # Linux 6.9 API change
|
||||||
|
dnl # blk_alloc_disk() takes 2 arguments:
|
||||||
|
dnl # a queue limit and NUMA node ID.
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 5.14 API Change:
|
AC_MSG_CHECKING([whether blk_alloc_disk() takes 2 args])
|
||||||
dnl # blk_alloc_queue() + alloc_disk() combo replaced by
|
ZFS_LINUX_TEST_RESULT([blk_alloc_disk_2args], [
|
||||||
dnl # a single call to blk_alloc_disk().
|
|
||||||
dnl #
|
|
||||||
AC_MSG_CHECKING([whether blk_alloc_disk() exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
|
AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
|
||||||
|
AC_DEFINE([HAVE_BLK_ALLOC_DISK_2ARGS], 1, [blk_alloc_disk() takes 2 args])
|
||||||
|
dnl # put_disk() should be used in 6.9.
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 5.20 API change,
|
dnl # Linux 5.14 API Change:
|
||||||
dnl # Removed blk_cleanup_disk(), put_disk() should be used.
|
dnl # blk_alloc_queue() + alloc_disk() combo replaced by
|
||||||
|
dnl # a single call to blk_alloc_disk().
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
|
AC_MSG_CHECKING([whether blk_alloc_disk() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
|
ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
|
AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
|
||||||
[blk_cleanup_disk() exists])
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.20 API change,
|
||||||
|
dnl # Removed blk_cleanup_disk(), put_disk() should be used.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
|
||||||
|
[blk_cleanup_disk() exists])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
|
@ -874,7 +874,11 @@ zvol_alloc(dev_t dev, const char *name)
|
||||||
|
|
||||||
#ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS
|
#ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS
|
||||||
#ifdef HAVE_BLK_ALLOC_DISK
|
#ifdef HAVE_BLK_ALLOC_DISK
|
||||||
|
#ifdef HAVE_BLK_ALLOC_DISK_2ARGS
|
||||||
|
zso->zvo_disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
|
||||||
|
#else
|
||||||
zso->zvo_disk = blk_alloc_disk(NUMA_NO_NODE);
|
zso->zvo_disk = blk_alloc_disk(NUMA_NO_NODE);
|
||||||
|
#endif
|
||||||
if (zso->zvo_disk == NULL)
|
if (zso->zvo_disk == NULL)
|
||||||
goto out_kmem;
|
goto out_kmem;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue