mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
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 <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes #16400
This commit is contained in:
@@ -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])
|
||||
])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user