diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 40 | 
1 files changed, 6 insertions, 34 deletions
| diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 557d46728577..f98f28c12020 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -218,6 +218,8 @@ static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,  static int proc_dostring_coredump(struct ctl_table *table, int write,  		void __user *buffer, size_t *lenp, loff_t *ppos);  #endif +static int proc_dopipe_max_size(struct ctl_table *table, int write, +		void __user *buffer, size_t *lenp, loff_t *ppos);  #ifdef CONFIG_MAGIC_SYSRQ  /* Note: sysrq code uses it's own private copy */ @@ -1374,13 +1376,6 @@ static struct ctl_table vm_table[] = {  		.mode		= 0644,  		.proc_handler	= proc_dointvec,  	 }, -	 { -		.procname	= "hugepages_treat_as_movable", -		.data		= &hugepages_treat_as_movable, -		.maxlen		= sizeof(int), -		.mode		= 0644, -		.proc_handler	= proc_dointvec, -	},  	{  		.procname	= "nr_overcommit_hugepages",  		.data		= NULL, @@ -1819,8 +1814,7 @@ static struct ctl_table fs_table[] = {  		.data		= &pipe_max_size,  		.maxlen		= sizeof(pipe_max_size),  		.mode		= 0644, -		.proc_handler	= &pipe_proc_fn, -		.extra1		= &pipe_min_size, +		.proc_handler	= proc_dopipe_max_size,  	},  	{  		.procname	= "pipe-user-pages-hard", @@ -2622,29 +2616,17 @@ int proc_douintvec_minmax(struct ctl_table *table, int write,  				 do_proc_douintvec_minmax_conv, ¶m);  } -struct do_proc_dopipe_max_size_conv_param { -	unsigned int *min; -}; -  static int do_proc_dopipe_max_size_conv(unsigned long *lvalp,  					unsigned int *valp,  					int write, void *data)  { -	struct do_proc_dopipe_max_size_conv_param *param = data; -  	if (write) {  		unsigned int val; -		if (*lvalp > UINT_MAX) -			return -EINVAL; -  		val = round_pipe_size(*lvalp);  		if (val == 0)  			return -EINVAL; -		if (param->min && *param->min > val) -			return -ERANGE; -  		*valp = val;  	} else {  		unsigned int val = *valp; @@ -2654,14 +2636,11 @@ static int do_proc_dopipe_max_size_conv(unsigned long *lvalp,  	return 0;  } -int proc_dopipe_max_size(struct ctl_table *table, int write, -			 void __user *buffer, size_t *lenp, loff_t *ppos) +static int proc_dopipe_max_size(struct ctl_table *table, int write, +				void __user *buffer, size_t *lenp, loff_t *ppos)  { -	struct do_proc_dopipe_max_size_conv_param param = { -		.min = (unsigned int *) table->extra1, -	};  	return do_proc_douintvec(table, write, buffer, lenp, ppos, -				 do_proc_dopipe_max_size_conv, ¶m); +				 do_proc_dopipe_max_size_conv, NULL);  }  static void validate_coredump_safety(void) @@ -3167,12 +3146,6 @@ int proc_douintvec_minmax(struct ctl_table *table, int write,  	return -ENOSYS;  } -int proc_dopipe_max_size(struct ctl_table *table, int write, -			 void __user *buffer, size_t *lenp, loff_t *ppos) -{ -	return -ENOSYS; -} -  int proc_dointvec_jiffies(struct ctl_table *table, int write,  		    void __user *buffer, size_t *lenp, loff_t *ppos)  { @@ -3216,7 +3189,6 @@ EXPORT_SYMBOL(proc_douintvec);  EXPORT_SYMBOL(proc_dointvec_jiffies);  EXPORT_SYMBOL(proc_dointvec_minmax);  EXPORT_SYMBOL_GPL(proc_douintvec_minmax); -EXPORT_SYMBOL_GPL(proc_dopipe_max_size);  EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);  EXPORT_SYMBOL(proc_dointvec_ms_jiffies);  EXPORT_SYMBOL(proc_dostring); | 
