1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/fs/lockd
Joel Granados 1751f872cc treewide: const qualify ctl_tables where applicable
Add the const qualifier to all the ctl_tables in the tree except for
watchdog_hardlockup_sysctl, memory_allocation_profiling_sysctls,
loadpin_sysctl_table and the ones calling register_net_sysctl (./net,
drivers/inifiniband dirs). These are special cases as they use a
registration function with a non-const qualified ctl_table argument or
modify the arrays before passing them on to the registration function.

Constifying ctl_table structs will prevent the modification of
proc_handler function pointers as the arrays would reside in .rodata.
This is made possible after commit 78eb4ea25c ("sysctl: treewide:
constify the ctl_table argument of proc_handlers") constified all the
proc_handlers.

Created this by running an spatch followed by a sed command:
Spatch:
    virtual patch

    @
    depends on !(file in "net")
    disable optional_qualifier
    @

    identifier table_name != {
      watchdog_hardlockup_sysctl,
      iwcm_ctl_table,
      ucma_ctl_table,
      memory_allocation_profiling_sysctls,
      loadpin_sysctl_table
    };
    @@

    + const
    struct ctl_table table_name [] = { ... };

sed:
    sed --in-place \
      -e "s/struct ctl_table .table = &uts_kern/const struct ctl_table *table = \&uts_kern/" \
      kernel/utsname_sysctl.c

Reviewed-by: Song Liu <song@kernel.org>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> # for kernel/trace/
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Reviewed-by: Darrick J. Wong <djwong@kernel.org> # xfs
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
2025-01-28 13:48:37 +01:00
..
clnt4xdr.c lockd: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
clntlock.c lockd: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
clntproc.c lockd: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
clntxdr.c lockd: Fix comment about NLMv3 backwards compatibility 2024-11-18 20:22:58 -05:00
host.c lockd: discard nlmsvc_timeout 2024-09-01 10:04:56 -04:00
Makefile lockd: Use *-y instead of *-objs in Makefile 2024-07-08 14:10:03 -04:00
mon.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
netns.h filelock: move file locking definitions to separate header file 2023-01-11 06:52:32 -05:00
procfs.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
procfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
svc.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
svc4proc.c lockd: Remove unneeded initialization of file_lock::c.flc_flags 2024-11-18 20:23:04 -05:00
svclock.c NFSD 6.13 Release Notes 2024-11-26 12:59:30 -08:00
svcproc.c lockd: Remove unused parameter to nlmsvc_testlock() 2024-11-18 20:23:04 -05:00
svcshare.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
svcsubs.c lockd: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
svcxdr.h NLM: Fix svcxdr_encode_owner() 2021-09-17 10:35:10 -04:00
trace.c lockd: add some client-side tracepoints 2023-04-26 09:05:00 -04:00
trace.h lockd: add some client-side tracepoints 2023-04-26 09:05:00 -04:00
xdr.c lockd: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
xdr4.c lockd: Remove unneeded initialization of file_lock::c.flc_flags 2024-11-18 20:23:04 -05:00