diff options
author | Rob Norris <[email protected]> | 2024-07-31 12:15:07 +1000 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2024-08-22 15:42:14 -0700 |
commit | 464747ffd3d5517b0871bdfdd817dbc39551d397 (patch) | |
tree | a94758616add0562f5e147ad310b0f7bde039c28 /config | |
parent | 92a8af0f8b74a9a091ad578b28d59a99641374c1 (diff) |
Linux 6.11: first arg to proc_handler is now const
Detect it, and use a macro to make sure we always match the prototype.
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #16400
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel-register_sysctl_table.m4 | 33 | ||||
-rw-r--r-- | config/kernel.m4 | 2 |
2 files changed, 35 insertions, 0 deletions
diff --git a/config/kernel-register_sysctl_table.m4 b/config/kernel-register_sysctl_table.m4 index a5e934f56..b8a0e0b17 100644 --- a/config/kernel-register_sysctl_table.m4 +++ b/config/kernel-register_sysctl_table.m4 @@ -25,3 +25,36 @@ AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE], [ AC_MSG_RESULT([no]) ]) ]) + +dnl # +dnl # Linux 6.11 makes const the ctl_table arg of proc_handler +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST], [ + ZFS_LINUX_TEST_SRC([has_proc_handler_ctl_table_const], [ + #include <linux/sysctl.h> + + static int test_handler( + const struct ctl_table *ctl __attribute((unused)), + int write __attribute((unused)), + void *buffer __attribute((unused)), + size_t *lenp __attribute((unused)), + loff_t *ppos __attribute((unused))) + { + return (0); + } + ], [ + proc_handler *ph __attribute((unused)) = + &test_handler; + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST], [ + AC_MSG_CHECKING([whether proc_handler ctl_table arg is const]) + ZFS_LINUX_TEST_RESULT([has_proc_handler_ctl_table_const], [ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_PROC_HANDLER_CTL_TABLE_CONST, 1, + [proc_handler ctl_table arg is const]) + ], [ + AC_MSG_RESULT([no]) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index b51477b6a..209dbf42f 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -166,6 +166,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_WRITEPAGE_T ZFS_AC_KERNEL_SRC_RECLAIMED ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE + ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST ZFS_AC_KERNEL_SRC_COPY_SPLICE_READ ZFS_AC_KERNEL_SRC_SYNC_BDEV ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE @@ -317,6 +318,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_WRITEPAGE_T ZFS_AC_KERNEL_RECLAIMED ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE + ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST ZFS_AC_KERNEL_COPY_SPLICE_READ ZFS_AC_KERNEL_SYNC_BDEV ZFS_AC_KERNEL_MM_PAGE_SIZE |