diff options
author | Brian Behlendorf <[email protected]> | 2022-08-03 11:35:47 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-08-04 16:57:33 -0700 |
commit | bebdf52a16b107e20baf76899b4cb131a95a6887 (patch) | |
tree | 64c8f8d4b0d9fd146810ad28531622a7788a8f86 /config/kernel-blkdev.m4 | |
parent | 673aa7e6cff21ad5260497edfda8ad0f720ac212 (diff) |
Linux 5.20 compat: bdevname()
As of the Linux 5.20 kernel bdevname() has been removed, all
callers should use snprintf() and the "%pg" format specifier.
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #13728
Diffstat (limited to 'config/kernel-blkdev.m4')
-rw-r--r-- | config/kernel-blkdev.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/kernel-blkdev.m4 b/config/kernel-blkdev.m4 index fb7b1a458..462d6c6ef 100644 --- a/config/kernel-blkdev.m4 +++ b/config/kernel-blkdev.m4 @@ -295,6 +295,32 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE], [ ]) dnl # +dnl # 5.20 API change, +dnl # Removed bdevname(), snprintf(.., %pg) should be used. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEVNAME], [ + ZFS_LINUX_TEST_SRC([bdevname], [ + #include <linux/fs.h> + #include <linux/blkdev.h> + ], [ + struct block_device *bdev __attribute__ ((unused)) = NULL; + char path[BDEVNAME_SIZE]; + + (void) bdevname(bdev, path); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEVNAME], [ + AC_MSG_CHECKING([whether bdevname() exists]) + ZFS_LINUX_TEST_RESULT([bdevname], [ + AC_DEFINE(HAVE_BDEVNAME, 1, [bdevname() is available]) + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) +]) + +dnl # dnl # 5.19 API: blkdev_issue_secure_erase() dnl # 3.10 API: blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE) dnl # @@ -377,6 +403,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [ ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE + ZFS_AC_KERNEL_SRC_BLKDEV_BDEVNAME ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE ]) @@ -391,6 +418,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [ ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE + ZFS_AC_KERNEL_BLKDEV_BDEVNAME ZFS_AC_KERNEL_BLKDEV_GET_ERESTARTSYS ZFS_AC_KERNEL_BLKDEV_ISSUE_SECURE_ERASE ]) |