Source
7
7
* modify it under the terms of the GNU General Public License as
8
8
* published by the Free Software Foundation, version 2 of the
9
9
* License.
10
10
*/
11
11
12
12
#include <linux/nsproxy.h>
13
13
#include <linux/ipc_namespace.h>
14
14
#include <linux/sysctl.h>
15
15
16
16
#ifdef CONFIG_PROC_SYSCTL
17
-
static void *get_mq(ctl_table *table)
17
+
static void *get_mq(struct ctl_table *table)
18
18
{
19
19
char *which = table->data;
20
20
struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns;
21
21
which = (which - (char *)&init_ipc_ns) + (char *)ipc_ns;
22
22
return which;
23
23
}
24
24
25
-
static int proc_mq_dointvec(ctl_table *table, int write,
25
+
static int proc_mq_dointvec(struct ctl_table *table, int write,
26
26
void __user *buffer, size_t *lenp, loff_t *ppos)
27
27
{
28
28
struct ctl_table mq_table;
29
29
memcpy(&mq_table, table, sizeof(mq_table));
30
30
mq_table.data = get_mq(table);
31
31
32
32
return proc_dointvec(&mq_table, write, buffer, lenp, ppos);
33
33
}
34
34
35
-
static int proc_mq_dointvec_minmax(ctl_table *table, int write,
35
+
static int proc_mq_dointvec_minmax(struct ctl_table *table, int write,
36
36
void __user *buffer, size_t *lenp, loff_t *ppos)
37
37
{
38
38
struct ctl_table mq_table;
39
39
memcpy(&mq_table, table, sizeof(mq_table));
40
40
mq_table.data = get_mq(table);
41
41
42
42
return proc_dointvec_minmax(&mq_table, write, buffer,
43
43
lenp, ppos);
44
44
}
45
45
#else
46
46
#define proc_mq_dointvec NULL
47
47
#define proc_mq_dointvec_minmax NULL
48
48
#endif
49
49
50
50
static int msg_max_limit_min = MIN_MSGMAX;
51
51
static int msg_max_limit_max = HARD_MSGMAX;
52
52
53
53
static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
54
54
static int msg_maxsize_limit_max = HARD_MSGSIZEMAX;
55
55
56
-
static ctl_table mq_sysctls[] = {
56
+
static struct ctl_table mq_sysctls[] = {
57
57
{
58
58
.procname = "queues_max",
59
59
.data = &init_ipc_ns.mq_queues_max,
60
60
.maxlen = sizeof(int),
61
61
.mode = 0644,
62
62
.proc_handler = proc_mq_dointvec,
63
63
},
64
64
{
65
65
.procname = "msg_max",
66
66
.data = &init_ipc_ns.mq_msg_max,
93
93
.data = &init_ipc_ns.mq_msgsize_default,
94
94
.maxlen = sizeof(int),
95
95
.mode = 0644,
96
96
.proc_handler = proc_mq_dointvec_minmax,
97
97
.extra1 = &msg_maxsize_limit_min,
98
98
.extra2 = &msg_maxsize_limit_max,
99
99
},
100
100
{}
101
101
};
102
102
103
-
static ctl_table mq_sysctl_dir[] = {
103
+
static struct ctl_table mq_sysctl_dir[] = {
104
104
{
105
105
.procname = "mqueue",
106
106
.mode = 0555,
107
107
.child = mq_sysctls,
108
108
},
109
109
{}
110
110
};
111
111
112
-
static ctl_table mq_sysctl_root[] = {
112
+
static struct ctl_table mq_sysctl_root[] = {
113
113
{
114
114
.procname = "fs",
115
115
.mode = 0555,
116
116
.child = mq_sysctl_dir,
117
117
},
118
118
{}
119
119
};
120
120
121
121
struct ctl_table_header *mq_register_sysctl_table(void)
122
122
{