lkml.org 
[lkml]   [2009]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] mqueue namespace: adapt sysctl
On Mon, Feb 23, 2009 at 09:09:33PM -0600, Serge E. Hallyn wrote:
> +#ifdef CONFIG_PROC_FS
> +static int proc_mq_dointvec(ctl_table *table, int write, struct file *filp,
> + void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> + struct ctl_table mq_table;
> + memcpy(&mq_table, table, sizeof(mq_table));
> + mq_table.data = get_mq(table);
> +
> + return proc_dointvec(&mq_table, write, filp, buffer, lenp, ppos);
> +}
> +
> +static int proc_mq_dointvec_minmax(ctl_table *table, int write,
> + struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> + struct ctl_table mq_table;
> + memcpy(&mq_table, table, sizeof(mq_table));
> + mq_table.data = get_mq(table);
> +
> + return proc_dointvec_minmax(&mq_table, write, filp, buffer,
> + lenp, ppos);
> +}
> +#else /* CONFIG_PROC_FS */
> +static int proc_mq_dointvec(ctl_table *table, int write, struct file *filp,
> + void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> + return -ENOSYS;
> +}
> +
> +static int proc_mq_dointvec_minmax(ctl_table *table, int write,
> + struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> + return -ENOSYS;
> +}
> +#endif /* CONFIG_PROC_FS */

These should be under CONFIG_PROC_SYSCTL and one should define them to
NULL otherwise.

> +static ctl_table mq_sysctls[] = {
> + {
> + .procname = "queues_max",
> + .data = &init_ipc_ns.mq_queues_max,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = &proc_mq_dointvec,
^
No &, please. I'm removing them.

> + },
> + {
> + .procname = "msg_max",
> + .data = &init_ipc_ns.mq_msg_max,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = &proc_mq_dointvec_minmax,
> + .extra1 = &msg_max_limit_min,
> + .extra2 = &msg_max_limit_max,
> + },
> + {
> + .procname = "msgsize_max",
> + .data = &init_ipc_ns.mq_msgsize_max,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = &proc_mq_dointvec_minmax,
> + .extra1 = &msg_maxsize_limit_min,
> + .extra2 = &msg_maxsize_limit_max,
> + },


\
 
 \ /
  Last update: 2009-02-24 05:31    [W:0.045 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site