aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorSerge E. Hallyn <serue@us.ibm.com>2009-04-06 22:01:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:09 -0400
commitbdc8e5f85f9abe2e7c78dcf39d81f9a97178788b (patch)
treea25a9d10f3686c4cb309d2477376ee585322ef43 /ipc/mqueue.c
parent7eafd7c74c3f2e67c27621b987b28397110d643f (diff)
namespaces: mqueue namespace: adapt sysctl
Largely inspired from ipc/ipc_sysctl.c. This patch isolates the mqueue sysctl stuff in its own file. [akpm@linux-foundation.org: build fix] Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r--ipc/mqueue.c65
1 files changed, 1 insertions, 64 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index c82d7b51ef68..e35ba2c3a8d7 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -47,15 +47,6 @@
47#define STATE_PENDING 1 47#define STATE_PENDING 1
48#define STATE_READY 2 48#define STATE_READY 2
49 49
50/*
51 * Define the ranges various user-specified maximum values can
52 * be set to.
53 */
54#define MIN_MSGMAX 1 /* min value for msg_max */
55#define MAX_MSGMAX HARD_MSGMAX /* max value for msg_max */
56#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */
57#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */
58
59struct ext_wait_queue { /* queue of sleeping tasks */ 50struct ext_wait_queue { /* queue of sleeping tasks */
60 struct task_struct *task; 51 struct task_struct *task;
61 struct list_head list; 52 struct list_head list;
@@ -1271,60 +1262,6 @@ void mq_put_mnt(struct ipc_namespace *ns)
1271 mntput(ns->mq_mnt); 1262 mntput(ns->mq_mnt);
1272} 1263}
1273 1264
1274static int msg_max_limit_min = MIN_MSGMAX;
1275static int msg_max_limit_max = MAX_MSGMAX;
1276
1277static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
1278static int msg_maxsize_limit_max = MAX_MSGSIZEMAX;
1279
1280static ctl_table mq_sysctls[] = {
1281 {
1282 .procname = "queues_max",
1283 .data = &init_ipc_ns.mq_queues_max,
1284 .maxlen = sizeof(int),
1285 .mode = 0644,
1286 .proc_handler = &proc_dointvec,
1287 },
1288 {
1289 .procname = "msg_max",
1290 .data = &init_ipc_ns.mq_msg_max,
1291 .maxlen = sizeof(int),
1292 .mode = 0644,
1293 .proc_handler = &proc_dointvec_minmax,
1294 .extra1 = &msg_max_limit_min,
1295 .extra2 = &msg_max_limit_max,
1296 },
1297 {
1298 .procname = "msgsize_max",
1299 .data = &init_ipc_ns.mq_msgsize_max,
1300 .maxlen = sizeof(int),
1301 .mode = 0644,
1302 .proc_handler = &proc_dointvec_minmax,
1303 .extra1 = &msg_maxsize_limit_min,
1304 .extra2 = &msg_maxsize_limit_max,
1305 },
1306 { .ctl_name = 0 }
1307};
1308
1309static ctl_table mq_sysctl_dir[] = {
1310 {
1311 .procname = "mqueue",
1312 .mode = 0555,
1313 .child = mq_sysctls,
1314 },
1315 { .ctl_name = 0 }
1316};
1317
1318static ctl_table mq_sysctl_root[] = {
1319 {
1320 .ctl_name = CTL_FS,
1321 .procname = "fs",
1322 .mode = 0555,
1323 .child = mq_sysctl_dir,
1324 },
1325 { .ctl_name = 0 }
1326};
1327
1328static int __init init_mqueue_fs(void) 1265static int __init init_mqueue_fs(void)
1329{ 1266{
1330 int error; 1267 int error;
@@ -1336,7 +1273,7 @@ static int __init init_mqueue_fs(void)
1336 return -ENOMEM; 1273 return -ENOMEM;
1337 1274
1338 /* ignore failues - they are not fatal */ 1275 /* ignore failues - they are not fatal */
1339 mq_sysctl_table = register_sysctl_table(mq_sysctl_root); 1276 mq_sysctl_table = mq_register_sysctl_table();
1340 1277
1341 error = register_filesystem(&mqueue_fs_type); 1278 error = register_filesystem(&mqueue_fs_type);
1342 if (error) 1279 if (error)