From 4f6599416afcbf88b536ceb147a3f100712b3c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 24 Jan 2022 20:11:07 +0100 Subject: [PATCH] Linux 5.17 compat: PDE_DATA() renamed to pde_data() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream commit 359745d78351c6f5442435f81549f0207ece28aa ("proc: remove PDE_DATA() completely") Link: https://lore.kernel.org/all/20211124081956.87711-2-songmuchun@bytedance.com/T/#u Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13004 Closes #12989 --- config/kernel-pde-data.m4 | 16 +++++++++------- module/os/linux/spl/spl-kstat.c | 2 +- module/os/linux/spl/spl-procfs-list.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config/kernel-pde-data.m4 b/config/kernel-pde-data.m4 index f866d77a11..4fc665dfbe 100644 --- a/config/kernel-pde-data.m4 +++ b/config/kernel-pde-data.m4 @@ -1,20 +1,22 @@ dnl # -dnl # 3.10 API change, -dnl # PDE is replaced by PDE_DATA +dnl # 5.17 API: PDE_DATA() renamed to pde_data(), +dnl # 359745d78351c6f5442435f81549f0207ece28aa ("proc: remove PDE_DATA() completely") dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_PDE_DATA], [ ZFS_LINUX_TEST_SRC([pde_data], [ #include ], [ - PDE_DATA(NULL); + pde_data(NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_PDE_DATA], [ - AC_MSG_CHECKING([whether PDE_DATA() is available]) - ZFS_LINUX_TEST_RESULT_SYMBOL([pde_data], [PDE_DATA], [], [ + AC_MSG_CHECKING([whether pde_data() is lowercase]) + ZFS_LINUX_TEST_RESULT([pde_data], [ AC_MSG_RESULT(yes) - ],[ - ZFS_LINUX_TEST_ERROR([PDE_DATA]) + AC_DEFINE(SPL_PDE_DATA, pde_data, [pde_data() is pde_data()]) + ], [ + AC_MSG_RESULT(no) + AC_DEFINE(SPL_PDE_DATA, PDE_DATA, [pde_data() is PDE_DATA()]) ]) ]) diff --git a/module/os/linux/spl/spl-kstat.c b/module/os/linux/spl/spl-kstat.c index 0c46708326..b5666e7884 100644 --- a/module/os/linux/spl/spl-kstat.c +++ b/module/os/linux/spl/spl-kstat.c @@ -418,7 +418,7 @@ proc_kstat_open(struct inode *inode, struct file *filp) return (rc); f = filp->private_data; - f->private = PDE_DATA(inode); + f->private = SPL_PDE_DATA(inode); return (0); } diff --git a/module/os/linux/spl/spl-procfs-list.c b/module/os/linux/spl/spl-procfs-list.c index cae13228c6..2cba1a3022 100644 --- a/module/os/linux/spl/spl-procfs-list.c +++ b/module/os/linux/spl/spl-procfs-list.c @@ -175,7 +175,7 @@ procfs_list_open(struct inode *inode, struct file *filp) struct seq_file *f = filp->private_data; procfs_list_cursor_t *cursor = f->private; - cursor->procfs_list = PDE_DATA(inode); + cursor->procfs_list = SPL_PDE_DATA(inode); cursor->cached_node = NULL; cursor->cached_pos = 0;