mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 07:54:36 -05:00
sysctl: treewide: constify the ctl_table argument of proc_handlers
const qualify the struct ctl_table argument in the proc_handler function
signatures. This is a prerequisite to moving the static ctl_table
structs into .rodata data which will ensure that proc_handler function
pointers cannot be modified.
This patch has been generated by the following coccinelle script:
```
virtual patch
@r1@
identifier ctl, write, buffer, lenp, ppos;
identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)";
@@
int func(
- struct ctl_table *ctl
+ const struct ctl_table *ctl
,int write, void *buffer, size_t *lenp, loff_t *ppos);
@r2@
identifier func, ctl, write, buffer, lenp, ppos;
@@
int func(
- struct ctl_table *ctl
+ const struct ctl_table *ctl
,int write, void *buffer, size_t *lenp, loff_t *ppos)
{ ... }
@r3@
identifier func;
@@
int func(
- struct ctl_table *
+ const struct ctl_table *
,int , void *, size_t *, loff_t *);
@r4@
identifier func, ctl;
@@
int func(
- struct ctl_table *ctl
+ const struct ctl_table *ctl
,int , void *, size_t *, loff_t *);
@r5@
identifier func, write, buffer, lenp, ppos;
@@
int func(
- struct ctl_table *
+ const struct ctl_table *
,int write, void *buffer, size_t *lenp, loff_t *ppos);
```
* Code formatting was adjusted in xfs_sysctl.c to comply with code
conventions. The xfs_stats_clear_proc_handler,
xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where
adjusted.
* The ctl_table argument in proc_watchdog_common was const qualified.
This is called from a proc_handler itself and is calling back into
another proc_handler, making it necessary to change it as part of the
proc_handler migration.
Co-developed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Co-developed-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Joel Granados <j.granados@samsung.com>
This commit is contained in:
@@ -5983,7 +5983,7 @@ const struct bpf_prog_ops bpf_syscall_prog_ops = {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int bpf_stats_handler(struct ctl_table *table, int write,
|
||||
static int bpf_stats_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct static_key *key = (struct static_key *)table->data;
|
||||
@@ -6018,7 +6018,7 @@ void __weak unpriv_ebpf_notify(int new_state)
|
||||
{
|
||||
}
|
||||
|
||||
static int bpf_unpriv_handler(struct ctl_table *table, int write,
|
||||
static int bpf_unpriv_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret, unpriv_enable = *(int *)table->data;
|
||||
|
||||
@@ -44,7 +44,7 @@ void delayacct_init(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROC_SYSCTL
|
||||
static int sysctl_delayacct(struct ctl_table *table, int write, void *buffer,
|
||||
static int sysctl_delayacct(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int state = delayacct_on;
|
||||
|
||||
@@ -270,7 +270,7 @@ get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user,
|
||||
* Used for sysctl_perf_event_max_stack and
|
||||
* sysctl_perf_event_max_contexts_per_stack.
|
||||
*/
|
||||
int perf_event_max_stack_handler(struct ctl_table *table, int write,
|
||||
int perf_event_max_stack_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int *value = table->data;
|
||||
|
||||
@@ -450,7 +450,7 @@ static void update_perf_cpu_limits(void)
|
||||
|
||||
static bool perf_rotate_context(struct perf_cpu_pmu_context *cpc);
|
||||
|
||||
int perf_event_max_sample_rate_handler(struct ctl_table *table, int write,
|
||||
int perf_event_max_sample_rate_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
@@ -474,7 +474,7 @@ int perf_event_max_sample_rate_handler(struct ctl_table *table, int write,
|
||||
|
||||
int sysctl_perf_cpu_time_max_percent __read_mostly = DEFAULT_CPU_TIME_MAX_PERCENT;
|
||||
|
||||
int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
|
||||
int perf_cpu_time_max_percent_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
|
||||
|
||||
@@ -3404,7 +3404,7 @@ int unshare_files(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sysctl_max_threads(struct ctl_table *table, int write,
|
||||
int sysctl_max_threads(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table t;
|
||||
|
||||
@@ -239,7 +239,7 @@ static long hung_timeout_jiffies(unsigned long last_checked,
|
||||
/*
|
||||
* Process updating of timeout sysctl
|
||||
*/
|
||||
static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
|
||||
static int proc_dohung_task_timeout_secs(const struct ctl_table *table, int write,
|
||||
void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
|
||||
@@ -888,7 +888,7 @@ struct kimage *kexec_crash_image;
|
||||
static int kexec_load_disabled;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int kexec_limit_handler(struct ctl_table *table, int write,
|
||||
static int kexec_limit_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct kexec_load_limit *limit = table->data;
|
||||
|
||||
@@ -939,7 +939,7 @@ static void unoptimize_all_kprobes(void)
|
||||
|
||||
static DEFINE_MUTEX(kprobe_sysctl_mutex);
|
||||
static int sysctl_kprobes_optimization;
|
||||
static int proc_kprobes_optimization_handler(struct ctl_table *table,
|
||||
static int proc_kprobes_optimization_handler(const struct ctl_table *table,
|
||||
int write, void *buffer,
|
||||
size_t *length, loff_t *ppos)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ static struct latency_record latency_record[MAXLR];
|
||||
int latencytop_enabled;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int sysctl_latencytop(struct ctl_table *table, int write, void *buffer,
|
||||
static int sysctl_latencytop(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -261,7 +261,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CHECKPOINT_RESTORE
|
||||
static int pid_ns_ctl_handler(struct ctl_table *table, int write,
|
||||
static int pid_ns_ctl_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct pid_namespace *pid_ns = task_active_pid_ns(current);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <linux/pid_namespace.h>
|
||||
|
||||
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE)
|
||||
static int pid_mfd_noexec_dointvec_minmax(struct ctl_table *table,
|
||||
static int pid_mfd_noexec_dointvec_minmax(const struct ctl_table *table,
|
||||
int write, void *buf, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct pid_namespace *ns = task_active_pid_ns(current);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
|
||||
void __init printk_sysctl_init(void);
|
||||
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
|
||||
int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos);
|
||||
#else
|
||||
#define printk_sysctl_init() do { } while (0)
|
||||
|
||||
@@ -197,7 +197,7 @@ __setup("printk.devkmsg=", control_devkmsg);
|
||||
|
||||
char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit";
|
||||
#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
|
||||
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
|
||||
int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
char old_str[DEVKMSG_STR_MAX_SIZE];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
static const int ten_thousand = 10000;
|
||||
|
||||
static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
|
||||
static int proc_dointvec_minmax_sysadmin(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
if (write && !capable(CAP_SYS_ADMIN))
|
||||
|
||||
@@ -1806,7 +1806,7 @@ static void uclamp_sync_util_min_rt_default(void)
|
||||
uclamp_update_util_min_rt_default(p);
|
||||
}
|
||||
|
||||
static int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
|
||||
static int sysctl_sched_uclamp_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
bool update_root_tg = false;
|
||||
@@ -4392,7 +4392,7 @@ static void reset_memory_tiering(void)
|
||||
}
|
||||
}
|
||||
|
||||
static int sysctl_numa_balancing(struct ctl_table *table, int write,
|
||||
static int sysctl_numa_balancing(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table t;
|
||||
@@ -4461,7 +4461,7 @@ static int __init setup_schedstats(char *str)
|
||||
__setup("schedstats=", setup_schedstats);
|
||||
|
||||
#ifdef CONFIG_PROC_SYSCTL
|
||||
static int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
|
||||
static int sysctl_schedstats(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table t;
|
||||
|
||||
@@ -26,9 +26,9 @@ int sysctl_sched_rt_runtime = 950000;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int sysctl_sched_rr_timeslice = (MSEC_PER_SEC * RR_TIMESLICE) / HZ;
|
||||
static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
|
||||
static int sched_rt_handler(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
static int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
|
||||
static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
static struct ctl_table sched_rt_sysctls[] = {
|
||||
{
|
||||
@@ -2952,7 +2952,7 @@ static void sched_rt_do_global(void)
|
||||
raw_spin_unlock_irqrestore(&def_rt_bandwidth.rt_runtime_lock, flags);
|
||||
}
|
||||
|
||||
static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
|
||||
static int sched_rt_handler(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int old_period, old_runtime;
|
||||
@@ -2991,7 +2991,7 @@ static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
|
||||
static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -285,7 +285,7 @@ void rebuild_sched_domains_energy(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROC_SYSCTL
|
||||
static int sched_energy_aware_handler(struct ctl_table *table, int write,
|
||||
static int sched_energy_aware_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret, state;
|
||||
|
||||
@@ -2431,7 +2431,7 @@ static void audit_actions_logged(u32 actions_logged, u32 old_actions_logged,
|
||||
return audit_seccomp_actions_logged(new, old, !ret);
|
||||
}
|
||||
|
||||
static int seccomp_actions_logged_handler(struct ctl_table *ro_table, int write,
|
||||
static int seccomp_actions_logged_handler(const struct ctl_table *ro_table, int write,
|
||||
void *buffer, size_t *lenp,
|
||||
loff_t *ppos)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass);
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int stack_erasing_sysctl(struct ctl_table *table, int write,
|
||||
static int stack_erasing_sysctl(const struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -256,7 +256,7 @@ static bool proc_first_pos_non_zero_ignore(loff_t *ppos,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dostring(struct ctl_table *table, int write,
|
||||
int proc_dostring(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
if (write)
|
||||
@@ -702,7 +702,7 @@ int do_proc_douintvec(const struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dobool(struct ctl_table *table, int write, void *buffer,
|
||||
int proc_dobool(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table tmp;
|
||||
@@ -739,7 +739,7 @@ int proc_dobool(struct ctl_table *table, int write, void *buffer,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dointvec(struct ctl_table *table, int write, void *buffer,
|
||||
int proc_dointvec(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
|
||||
@@ -758,7 +758,7 @@ int proc_dointvec(struct ctl_table *table, int write, void *buffer,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_douintvec(struct ctl_table *table, int write, void *buffer,
|
||||
int proc_douintvec(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_douintvec(table, write, buffer, lenp, ppos,
|
||||
@@ -769,7 +769,7 @@ int proc_douintvec(struct ctl_table *table, int write, void *buffer,
|
||||
* Taint values can only be increased
|
||||
* This means we can safely use a temporary.
|
||||
*/
|
||||
static int proc_taint(struct ctl_table *table, int write,
|
||||
static int proc_taint(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table t;
|
||||
@@ -864,7 +864,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
|
||||
*
|
||||
* Returns 0 on success or -EINVAL on write when the range check fails.
|
||||
*/
|
||||
int proc_dointvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_dointvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct do_proc_dointvec_minmax_conv_param param = {
|
||||
@@ -933,7 +933,7 @@ static int do_proc_douintvec_minmax_conv(unsigned long *lvalp,
|
||||
*
|
||||
* Returns 0 on success or -ERANGE on write when the range check fails.
|
||||
*/
|
||||
int proc_douintvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_douintvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct do_proc_douintvec_minmax_conv_param param = {
|
||||
@@ -961,7 +961,7 @@ int proc_douintvec_minmax(struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success or an error on write when the range check fails.
|
||||
*/
|
||||
int proc_dou8vec_minmax(struct ctl_table *table, int write,
|
||||
int proc_dou8vec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table tmp;
|
||||
@@ -998,7 +998,7 @@ int proc_dou8vec_minmax(struct ctl_table *table, int write,
|
||||
EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);
|
||||
|
||||
#ifdef CONFIG_MAGIC_SYSRQ
|
||||
static int sysrq_sysctl_handler(struct ctl_table *table, int write,
|
||||
static int sysrq_sysctl_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int tmp, ret;
|
||||
@@ -1115,7 +1115,7 @@ static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_doulongvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_doulongvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
|
||||
@@ -1138,7 +1138,7 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
|
||||
int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_doulongvec_minmax(table, write, buffer,
|
||||
@@ -1259,14 +1259,14 @@ static int do_proc_dointvec_ms_jiffies_minmax_conv(bool *negp, unsigned long *lv
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dointvec_jiffies(struct ctl_table *table, int write,
|
||||
int proc_dointvec_jiffies(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_dointvec(table,write,buffer,lenp,ppos,
|
||||
do_proc_dointvec_jiffies_conv,NULL);
|
||||
}
|
||||
|
||||
int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,
|
||||
int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct do_proc_dointvec_minmax_conv_param param = {
|
||||
@@ -1292,7 +1292,7 @@ int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
|
||||
int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_dointvec(table, write, buffer, lenp, ppos,
|
||||
@@ -1315,14 +1315,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void *buffer,
|
||||
int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return do_proc_dointvec(table, write, buffer, lenp, ppos,
|
||||
do_proc_dointvec_ms_jiffies_conv, NULL);
|
||||
}
|
||||
|
||||
static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer,
|
||||
static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct pid *new_pid;
|
||||
@@ -1361,7 +1361,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer,
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int proc_do_large_bitmap(struct ctl_table *table, int write,
|
||||
int proc_do_large_bitmap(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int err = 0;
|
||||
@@ -1493,85 +1493,85 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
|
||||
|
||||
#else /* CONFIG_PROC_SYSCTL */
|
||||
|
||||
int proc_dostring(struct ctl_table *table, int write,
|
||||
int proc_dostring(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dobool(struct ctl_table *table, int write,
|
||||
int proc_dobool(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec(struct ctl_table *table, int write,
|
||||
int proc_dointvec(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_douintvec(struct ctl_table *table, int write,
|
||||
int proc_douintvec(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_dointvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_douintvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_douintvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dou8vec_minmax(struct ctl_table *table, int write,
|
||||
int proc_dou8vec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec_jiffies(struct ctl_table *table, int write,
|
||||
int proc_dointvec_jiffies(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,
|
||||
int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
|
||||
int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
|
||||
int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_doulongvec_minmax(struct ctl_table *table, int write,
|
||||
int proc_doulongvec_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
|
||||
int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int proc_do_large_bitmap(struct ctl_table *table, int write,
|
||||
int proc_do_large_bitmap(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return -ENOSYS;
|
||||
@@ -1580,7 +1580,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
|
||||
#endif /* CONFIG_PROC_SYSCTL */
|
||||
|
||||
#if defined(CONFIG_SYSCTL)
|
||||
int proc_do_static_key(struct ctl_table *table, int write,
|
||||
int proc_do_static_key(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct static_key *key = (struct static_key *)table->data;
|
||||
|
||||
@@ -289,7 +289,7 @@ static void timers_update_migration(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int timer_migration_handler(struct ctl_table *table, int write,
|
||||
static int timer_migration_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -8735,7 +8735,7 @@ static bool is_permanent_ops_registered(void)
|
||||
}
|
||||
|
||||
static int
|
||||
ftrace_enable_sysctl(struct ctl_table *table, int write,
|
||||
ftrace_enable_sysctl(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret = -ENODEV;
|
||||
|
||||
@@ -2767,7 +2767,7 @@ static void output_printk(struct trace_event_buffer *fbuffer)
|
||||
raw_spin_unlock_irqrestore(&tracepoint_iter_lock, flags);
|
||||
}
|
||||
|
||||
int tracepoint_printk_sysctl(struct ctl_table *table, int write,
|
||||
int tracepoint_printk_sysctl(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp,
|
||||
loff_t *ppos)
|
||||
{
|
||||
|
||||
@@ -2885,7 +2885,7 @@ static int create_user_tracefs(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int set_max_user_events_sysctl(struct ctl_table *table, int write,
|
||||
static int set_max_user_events_sysctl(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -514,7 +514,7 @@ static const struct file_operations stack_trace_filter_fops = {
|
||||
#endif /* CONFIG_DYNAMIC_FTRACE */
|
||||
|
||||
int
|
||||
stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,
|
||||
stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int was_enabled;
|
||||
|
||||
@@ -495,7 +495,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait)
|
||||
EXPORT_SYMBOL(call_usermodehelper);
|
||||
|
||||
#if defined(CONFIG_SYSCTL)
|
||||
static int proc_cap_handler(struct ctl_table *table, int write,
|
||||
static int proc_cap_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table t;
|
||||
|
||||
@@ -30,7 +30,7 @@ static void *get_uts(const struct ctl_table *table)
|
||||
* Special case of dostring for the UTS structure. This has locks
|
||||
* to observe. Should this be in kernel/sys.c ????
|
||||
*/
|
||||
static int proc_do_uts_string(struct ctl_table *table, int write,
|
||||
static int proc_do_uts_string(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table uts_table;
|
||||
|
||||
@@ -983,7 +983,7 @@ static void proc_watchdog_update(void)
|
||||
* -------------------|----------------------------------|-------------------------------
|
||||
* proc_soft_watchdog | watchdog_softlockup_user_enabled | WATCHDOG_SOFTOCKUP_ENABLED
|
||||
*/
|
||||
static int proc_watchdog_common(int which, struct ctl_table *table, int write,
|
||||
static int proc_watchdog_common(int which, const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int err, old, *param = table->data;
|
||||
@@ -1010,7 +1010,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write,
|
||||
/*
|
||||
* /proc/sys/kernel/watchdog
|
||||
*/
|
||||
static int proc_watchdog(struct ctl_table *table, int write,
|
||||
static int proc_watchdog(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED |
|
||||
@@ -1021,7 +1021,7 @@ static int proc_watchdog(struct ctl_table *table, int write,
|
||||
/*
|
||||
* /proc/sys/kernel/nmi_watchdog
|
||||
*/
|
||||
static int proc_nmi_watchdog(struct ctl_table *table, int write,
|
||||
static int proc_nmi_watchdog(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
if (!watchdog_hardlockup_available && write)
|
||||
@@ -1034,7 +1034,7 @@ static int proc_nmi_watchdog(struct ctl_table *table, int write,
|
||||
/*
|
||||
* /proc/sys/kernel/soft_watchdog
|
||||
*/
|
||||
static int proc_soft_watchdog(struct ctl_table *table, int write,
|
||||
static int proc_soft_watchdog(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED,
|
||||
@@ -1045,7 +1045,7 @@ static int proc_soft_watchdog(struct ctl_table *table, int write,
|
||||
/*
|
||||
* /proc/sys/kernel/watchdog_thresh
|
||||
*/
|
||||
static int proc_watchdog_thresh(struct ctl_table *table, int write,
|
||||
static int proc_watchdog_thresh(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int err, old;
|
||||
@@ -1068,7 +1068,7 @@ static int proc_watchdog_thresh(struct ctl_table *table, int write,
|
||||
* user to specify a mask that will include cpus that have not yet
|
||||
* been brought online, if desired.
|
||||
*/
|
||||
static int proc_watchdog_cpumask(struct ctl_table *table, int write,
|
||||
static int proc_watchdog_cpumask(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int err;
|
||||
|
||||
Reference in New Issue
Block a user