diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
| commit | 08615d7d85e5aa02c05bf6c4dde87d940e7f85f6 (patch) | |
| tree | 18906149d313d25914160aca21cedf54b3a7e818 /ipc/mq_sysctl.c | |
| parent | 9fdadb2cbaf4b482dfd6086e8bd3d2db071a1702 (diff) | |
| parent | 0a4dd35c67b144d8ef9432120105f1aab9293ee9 (diff) | |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton:
- the "misc" tree - stuff from all over the map
- checkpatch updates
- fatfs
- kmod changes
- procfs
- cpumask
- UML
- kexec
- mqueue
- rapidio
- pidns
- some checkpoint-restore feature work. Reluctantly. Most of it
delayed a release. I'm still rather worried that we don't have a
clear roadmap to completion for this work.
* emailed from Andrew Morton <akpm@linux-foundation.org>: (78 patches)
kconfig: update compression algorithm info
c/r: prctl: add ability to set new mm_struct::exe_file
c/r: prctl: extend PR_SET_MM to set up more mm_struct entries
c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat
syscalls, x86: add __NR_kcmp syscall
fs, proc: introduce /proc/<pid>/task/<tid>/children entry
sysctl: make kernel.ns_last_pid control dependent on CHECKPOINT_RESTORE
aio/vfs: cleanup of rw_copy_check_uvector() and compat_rw_copy_check_uvector()
eventfd: change int to __u64 in eventfd_signal()
fs/nls: add Apple NLS
pidns: make killed children autoreap
pidns: use task_active_pid_ns in do_notify_parent
rapidio/tsi721: add DMA engine support
rapidio: add DMA engine support for RIO data transfers
ipc/mqueue: add rbtree node caching support
tools/selftests: add mq_perf_tests
ipc/mqueue: strengthen checks on mqueue creation
ipc/mqueue: correct mq_attr_ok test
ipc/mqueue: improve performance of send/recv
selftests: add mq_open_tests
...
Diffstat (limited to 'ipc/mq_sysctl.c')
| -rw-r--r-- | ipc/mq_sysctl.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c index 0c09366b96f3..383d638340b8 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 |
| 26 | static void *get_mq(ctl_table *table) | 17 | static 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 | ||
| 34 | static 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 | |||
| 44 | static int proc_mq_dointvec_minmax(ctl_table *table, int write, | 25 | static 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 | ||
| 39 | static int msg_queues_limit_min = MIN_QUEUESMAX; | ||
| 40 | static int msg_queues_limit_max = HARD_QUEUESMAX; | ||
| 41 | |||
| 59 | static int msg_max_limit_min = MIN_MSGMAX; | 42 | static int msg_max_limit_min = MIN_MSGMAX; |
| 60 | static int msg_max_limit_max = MAX_MSGMAX; | 43 | static int msg_max_limit_max = HARD_MSGMAX; |
| 61 | 44 | ||
| 62 | static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; | 45 | static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; |
| 63 | static int msg_maxsize_limit_max = MAX_MSGSIZEMAX; | 46 | static int msg_maxsize_limit_max = HARD_MSGSIZEMAX; |
| 64 | 47 | ||
| 65 | static ctl_table mq_sysctls[] = { | 48 | static 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", |
| @@ -88,6 +73,24 @@ static ctl_table mq_sysctls[] = { | |||
| 88 | .extra1 = &msg_maxsize_limit_min, | 73 | .extra1 = &msg_maxsize_limit_min, |
| 89 | .extra2 = &msg_maxsize_limit_max, | 74 | .extra2 = &msg_maxsize_limit_max, |
| 90 | }, | 75 | }, |
| 76 | { | ||
| 77 | .procname = "msg_default", | ||
| 78 | .data = &init_ipc_ns.mq_msg_default, | ||
| 79 | .maxlen = sizeof(int), | ||
| 80 | .mode = 0644, | ||
| 81 | .proc_handler = proc_mq_dointvec_minmax, | ||
| 82 | .extra1 = &msg_max_limit_min, | ||
| 83 | .extra2 = &msg_max_limit_max, | ||
| 84 | }, | ||
| 85 | { | ||
| 86 | .procname = "msgsize_default", | ||
| 87 | .data = &init_ipc_ns.mq_msgsize_default, | ||
| 88 | .maxlen = sizeof(int), | ||
| 89 | .mode = 0644, | ||
| 90 | .proc_handler = proc_mq_dointvec_minmax, | ||
| 91 | .extra1 = &msg_maxsize_limit_min, | ||
| 92 | .extra2 = &msg_maxsize_limit_max, | ||
| 93 | }, | ||
| 91 | {} | 94 | {} |
| 92 | }; | 95 | }; |
| 93 | 96 | ||
