diff options
author | Brian Behlendorf <[email protected]> | 2022-08-03 17:37:52 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-08-04 16:57:49 -0700 |
commit | c26045b435408ce30ffae86f8a65670cc1e97590 (patch) | |
tree | 5d2e71bf72b0e8449f5db1609d9a7f8141703c34 /config | |
parent | bebdf52a16b107e20baf76899b4cb131a95a6887 (diff) |
Linux 5.20 compat: blk_cleanup_disk()
As of the Linux 5.20 kernel blk_cleanup_disk() has been removed,
all callers should use put_disk().
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #13728
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel-make-request-fn.m4 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/config/kernel-make-request-fn.m4 b/config/kernel-make-request-fn.m4 index 86b202a7a..f17416acc 100644 --- a/config/kernel-make-request-fn.m4 +++ b/config/kernel-make-request-fn.m4 @@ -49,6 +49,13 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [ struct gendisk *disk __attribute__ ((unused)); disk = blk_alloc_disk(NUMA_NO_NODE); ]) + + ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [ + #include <linux/blkdev.h> + ],[ + struct gendisk *disk __attribute__ ((unused)); + blk_cleanup_disk(disk); + ]) ]) AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ @@ -73,6 +80,19 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_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) ]) |