aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-blkdev.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/kernel-blkdev.m4')
-rw-r--r--config/kernel-blkdev.m455
1 files changed, 41 insertions, 14 deletions
diff --git a/config/kernel-blkdev.m4 b/config/kernel-blkdev.m4
index 530b49f48..622a1af5d 100644
--- a/config/kernel-blkdev.m4
+++ b/config/kernel-blkdev.m4
@@ -154,42 +154,69 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [
])
dnl #
-dnl # 2.6.27, lookup_bdev() was exported.
-dnl # 4.4.0-6.21 - lookup_bdev() takes 2 arguments.
+dnl # 5.11 API, lookup_bdev() takes dev_t argument.
+dnl # 2.6.27 API, lookup_bdev() was first exported.
+dnl # 4.4.0-6.21 API, lookup_bdev() on Ubuntu takes mode argument.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
+ ZFS_LINUX_TEST_SRC([lookup_bdev_devt], [
+ #include <linux/blkdev.h>
+ ], [
+ int error __attribute__ ((unused));
+ const char path[] = "/example/path";
+ dev_t dev;
+
+ error = lookup_bdev(path, &dev);
+ ])
+
ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [
#include <linux/fs.h>
#include <linux/blkdev.h>
], [
- lookup_bdev(NULL);
+ struct block_device *bdev __attribute__ ((unused));
+ const char path[] = "/example/path";
+
+ bdev = lookup_bdev(path);
])
- ZFS_LINUX_TEST_SRC([lookup_bdev_2args], [
+ ZFS_LINUX_TEST_SRC([lookup_bdev_mode], [
#include <linux/fs.h>
], [
- lookup_bdev(NULL, FMODE_READ);
+ struct block_device *bdev __attribute__ ((unused));
+ const char path[] = "/example/path";
+
+ bdev = lookup_bdev(path, FMODE_READ);
])
])
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
- AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
- ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
+ AC_MSG_CHECKING([whether lookup_bdev() wants dev_t arg])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_devt],
[lookup_bdev], [fs/block_dev.c], [
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
- [lookup_bdev() wants 1 arg])
+ AC_DEFINE(HAVE_DEVT_LOOKUP_BDEV, 1,
+ [lookup_bdev() wants dev_t arg])
], [
AC_MSG_RESULT(no)
- AC_MSG_CHECKING([whether lookup_bdev() wants 2 args])
- ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_2args],
+ AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
[lookup_bdev], [fs/block_dev.c], [
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_2ARGS_LOOKUP_BDEV, 1,
- [lookup_bdev() wants 2 args])
+ AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
+ [lookup_bdev() wants 1 arg])
], [
- ZFS_LINUX_TEST_ERROR([lookup_bdev()])
+ AC_MSG_RESULT(no)
+
+ AC_MSG_CHECKING([whether lookup_bdev() wants mode arg])
+ ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_mode],
+ [lookup_bdev], [fs/block_dev.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MODE_LOOKUP_BDEV, 1,
+ [lookup_bdev() wants mode arg])
+ ], [
+ ZFS_LINUX_TEST_ERROR([lookup_bdev()])
+ ])
])
])
])