xref: /freebsd/sys/contrib/openzfs/config/kernel-add-disk.m4 (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
1dnl #
2dnl # 5.16 API change
3dnl # add_disk grew a must-check return code
4dnl #
5AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [
6	ZFS_LINUX_TEST_SRC([add_disk_ret], [
7		#include <linux/blkdev.h>
8	], [
9		struct gendisk *disk = NULL;
10		int error __attribute__ ((unused)) = add_disk(disk);
11	])
12])
13
14AC_DEFUN([ZFS_AC_KERNEL_ADD_DISK], [
15	AC_MSG_CHECKING([whether add_disk() returns int])
16	ZFS_LINUX_TEST_RESULT([add_disk_ret],
17	[
18		AC_MSG_RESULT(yes)
19		AC_DEFINE(HAVE_ADD_DISK_RET, 1,
20		    [add_disk() returns int])
21	], [
22		AC_MSG_RESULT(no)
23	])
24])
25