aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2014-06-06 17:37:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:14 -0400
commiteb66ec44f867834de054544b09b573de3a7ae456 (patch)
tree4fabad7ced4ce6145d44e8e25bd6ee111712e9f8 /ipc/msg.c
parent3e4e0f0a8756dade3023d1f47d50fbced7749788 (diff)
ipc: constify ipc_ops
There is no need to recreate the very same ipc_ops structure on every kernel entry for msgget/semget/shmget. Just declare it static and be done with it. While at it, constify it as we don't modify the structure at runtime. Found in the PaX patch, written by the PaX Team. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: PaX Team <pageexec@freemail.hu> Cc: Davidlohr Bueso <davidlohr@hp.com> Cc: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 649853105a5d..35e4018de53c 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -306,15 +306,14 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
306SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg) 306SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg)
307{ 307{
308 struct ipc_namespace *ns; 308 struct ipc_namespace *ns;
309 struct ipc_ops msg_ops; 309 static const struct ipc_ops msg_ops = {
310 .getnew = newque,
311 .associate = msg_security,
312 };
310 struct ipc_params msg_params; 313 struct ipc_params msg_params;
311 314
312 ns = current->nsproxy->ipc_ns; 315 ns = current->nsproxy->ipc_ns;
313 316
314 msg_ops.getnew = newque;
315 msg_ops.associate = msg_security;
316 msg_ops.more_checks = NULL;
317
318 msg_params.key = key; 317 msg_params.key = key;
319 msg_params.flg = msgflg; 318 msg_params.flg = msgflg;
320 319