mirror of
https://git.proxmox.com/git/mirror_zfs
synced 2025-04-28 18:28:46 +00:00

As of kernel v5.8, pin_user_pages* interfaced were introduced. These interfaces use the FOLL_PIN flag. This is preferred interface now for Direct I/O requests in the kernel. The reasoning for using this new interface for Direct I/O requests is explained in the kernel documenetation: Documentation/core-api/pin_user_pages.rst If pin_user_pages_unlocked is available, the all Direct I/O requests will use this new API to stay uptodate with the kernel API requirements. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Atkinson <batkinson@lanl.gov> Closes #16856
34 lines
853 B
Plaintext
34 lines
853 B
Plaintext
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)
|
|
])
|
|
])
|