mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Cc: PaX Team <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Manfred Spraul <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3e4e0f0a87
commit
eb66ec44f8
5 changed files with 19 additions and 20 deletions
10
ipc/shm.c
10
ipc/shm.c
|
|
@ -609,15 +609,15 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
|
|||
SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg)
|
||||
{
|
||||
struct ipc_namespace *ns;
|
||||
struct ipc_ops shm_ops;
|
||||
static const struct ipc_ops shm_ops = {
|
||||
.getnew = newseg,
|
||||
.associate = shm_security,
|
||||
.more_checks = shm_more_checks,
|
||||
};
|
||||
struct ipc_params shm_params;
|
||||
|
||||
ns = current->nsproxy->ipc_ns;
|
||||
|
||||
shm_ops.getnew = newseg;
|
||||
shm_ops.associate = shm_security;
|
||||
shm_ops.more_checks = shm_more_checks;
|
||||
|
||||
shm_params.key = key;
|
||||
shm_params.flg = shmflg;
|
||||
shm_params.u.size = size;
|
||||
|
|
|
|||
Loading…
Reference in a new issue