mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
becc717f61
On some architectures ZERO_PAGE is unavailable because it references
a GPL exported symbol of empty_zero_page. Originally e08b993
removed
the call to PAGE_ZERO(0) for assignment to the abd_zero_page. However,
a simple check can be done to avoid a kernel allocation and free for
the abd_zero_page if ZERO_PAGE is available.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brian Atkinson <batkinson@lanl.gov>
Closes #13199
28 lines
657 B
Plaintext
28 lines
657 B
Plaintext
dnl #
|
|
dnl # ZERO_PAGE() is an alias for emtpy_zero_page. On certain architectures
|
|
dnl # this is a GPL exported variable.
|
|
dnl #
|
|
|
|
dnl #
|
|
dnl # Checking if ZERO_PAGE is exported GPL-only
|
|
dnl #
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ZERO_PAGE], [
|
|
ZFS_LINUX_TEST_SRC([zero_page], [
|
|
#include <asm/pgtable.h>
|
|
], [
|
|
struct page *p __attribute__ ((unused));
|
|
p = ZERO_PAGE(0);
|
|
], [], [ZFS_META_LICENSE])
|
|
])
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_ZERO_PAGE], [
|
|
AC_MSG_CHECKING([whether ZERO_PAGE() is GPL-only])
|
|
ZFS_LINUX_TEST_RESULT([zero_page_license], [
|
|
AC_MSG_RESULT(no)
|
|
], [
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(HAVE_ZERO_PAGE_GPL_ONLY, 1,
|
|
[ZERO_PAGE() is GPL-only])
|
|
])
|
|
])
|