File: kernel-generic_fadvise.m4

package info (click to toggle)
zfs-linux 2.3.4~git20250812.3b64a96-1
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 70,688 kB
  • sloc: ansic: 393,668; sh: 68,068; asm: 47,734; python: 8,160; makefile: 5,125; perl: 859; sed: 41
file content (27 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
dnl #
dnl # 5.3 API change
dnl # The generic_fadvise() function is present since 4.19 kernel
dnl # but it was not exported until Linux 5.3.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_FADVISE], [
	ZFS_LINUX_TEST_SRC([generic_fadvise], [
		#include <linux/fs.h>
	], [
		struct file *fp __attribute__ ((unused)) = NULL;
		loff_t offset __attribute__ ((unused)) = 0;
		loff_t len __attribute__ ((unused)) = 0;
		int advise __attribute__ ((unused)) = 0;
		generic_fadvise(fp, offset, len, advise);
	])
])

AC_DEFUN([ZFS_AC_KERNEL_GENERIC_FADVISE], [
	AC_MSG_CHECKING([whether generic_fadvise() is available])
	ZFS_LINUX_TEST_RESULT_SYMBOL([generic_fadvise],
	[generic_fadvise], [mm/fadvise.c], [
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_GENERIC_FADVISE, 1, [yes])
	],[
		AC_MSG_RESULT(no)
	])
])