aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-add-disk.m4
blob: 86d81ea325b93f181f1c5ceba6f8057238b9f595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
dnl #
dnl # 5.16 API change
dnl # add_disk grew a must-check return code
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [
	ZFS_LINUX_TEST_SRC([add_disk_ret], [
		#include <linux/blkdev.h>
	], [
		struct gendisk *disk = NULL;
		int error __attribute__ ((unused)) = add_disk(disk);
	])
])

AC_DEFUN([ZFS_AC_KERNEL_ADD_DISK], [
	AC_MSG_CHECKING([whether add_disk() returns int])
	ZFS_LINUX_TEST_RESULT([add_disk_ret],
	[
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_ADD_DISK_RET, 1,
		    [add_disk() returns int])
	], [
		AC_MSG_RESULT(no)
	])
])