File: kernel-pin-user-pages.m4

package info (click to toggle)
zfs-linux 2.3.2-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid, trixie
  • size: 71,496 kB
  • sloc: ansic: 392,648; sh: 67,208; asm: 47,693; python: 8,160; makefile: 5,100; perl: 839; sed: 41
file content (33 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
dnl #
dnl # Check for pin_user_pages_unlocked().
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_PIN_USER_PAGES], [
	ZFS_LINUX_TEST_SRC([pin_user_pages_unlocked], [
		#include <linux/mm.h>
	],[
		unsigned long start = 0;
		unsigned long nr_pages = 1;
		struct page **pages = NULL;
		unsigned int gup_flags = 0;
		long ret __attribute__ ((unused));

		ret = pin_user_pages_unlocked(start, nr_pages, pages,
		    gup_flags);
	])
])

AC_DEFUN([ZFS_AC_KERNEL_PIN_USER_PAGES], [

	dnl #
	dnl # Kernal 5.8 introduced the pin_user_pages* interfaces which should
	dnl # be used for Direct I/O requests.
	dnl #
	AC_MSG_CHECKING([whether pin_user_pages_unlocked() is available])
	ZFS_LINUX_TEST_RESULT([pin_user_pages_unlocked], [
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_PIN_USER_PAGES_UNLOCKED, 1,
		    [pin_user_pages_unlocked() is available])
	],[
		AC_MSG_RESULT(no)
	])
])