aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/mq_sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/mq_sysctl.c')
-rw-r--r--ipc/mq_sysctl.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c
index 0c09366b96f3..e22336a09b4a 100644
--- a/ipc/mq_sysctl.c
+++ b/ipc/mq_sysctl.c
@@ -13,15 +13,6 @@
13#include <linux/ipc_namespace.h> 13#include <linux/ipc_namespace.h>
14#include <linux/sysctl.h> 14#include <linux/sysctl.h>
15 15
16/*
17 * Define the ranges various user-specified maximum values can
18 * be set to.
19 */
20#define MIN_MSGMAX 1 /* min value for msg_max */
21#define MAX_MSGMAX HARD_MSGMAX /* max value for msg_max */
22#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */
23#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */
24
25#ifdef CONFIG_PROC_SYSCTL 16#ifdef CONFIG_PROC_SYSCTL
26static void *get_mq(ctl_table *table) 17static void *get_mq(ctl_table *table)
27{ 18{
@@ -31,16 +22,6 @@ static void *get_mq(ctl_table *table)
31 return which; 22 return which;
32} 23}
33 24
34static int proc_mq_dointvec(ctl_table *table, int write,
35 void __user *buffer, size_t *lenp, loff_t *ppos)
36{
37 struct ctl_table mq_table;
38 memcpy(&mq_table, table, sizeof(mq_table));
39 mq_table.data = get_mq(table);
40
41 return proc_dointvec(&mq_table, write, buffer, lenp, ppos);
42}
43
44static int proc_mq_dointvec_minmax(ctl_table *table, int write, 25static int proc_mq_dointvec_minmax(ctl_table *table, int write,
45 void __user *buffer, size_t *lenp, loff_t *ppos) 26 void __user *buffer, size_t *lenp, loff_t *ppos)
46{ 27{
@@ -52,15 +33,17 @@ static int proc_mq_dointvec_minmax(ctl_table *table, int write,
52 lenp, ppos); 33 lenp, ppos);
53} 34}
54#else 35#else
55#define proc_mq_dointvec NULL
56#define proc_mq_dointvec_minmax NULL 36#define proc_mq_dointvec_minmax NULL
57#endif 37#endif
58 38
39static int msg_queues_limit_min = MIN_QUEUESMAX;
40static int msg_queues_limit_max = HARD_QUEUESMAX;
41
59static int msg_max_limit_min = MIN_MSGMAX; 42static int msg_max_limit_min = MIN_MSGMAX;
60static int msg_max_limit_max = MAX_MSGMAX; 43static int msg_max_limit_max = HARD_MSGMAX;
61 44
62static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; 45static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
63static int msg_maxsize_limit_max = MAX_MSGSIZEMAX; 46static int msg_maxsize_limit_max = HARD_MSGSIZEMAX;
64 47
65static ctl_table mq_sysctls[] = { 48static ctl_table mq_sysctls[] = {
66 { 49 {
@@ -68,7 +51,9 @@ static ctl_table mq_sysctls[] = {
68 .data = &init_ipc_ns.mq_queues_max, 51 .data = &init_ipc_ns.mq_queues_max,
69 .maxlen = sizeof(int), 52 .maxlen = sizeof(int),
70 .mode = 0644, 53 .mode = 0644,
71 .proc_handler = proc_mq_dointvec, 54 .proc_handler = proc_mq_dointvec_minmax,
55 .extra1 = &msg_queues_limit_min,
56 .extra2 = &msg_queues_limit_max,
72 }, 57 },
73 { 58 {
74 .procname = "msg_max", 59 .procname = "msg_max",