]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ipc: add sysctl to specify desired next object id
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 9 Nov 2012 03:05:05 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Nov 2012 04:55:22 +0000 (15:55 +1100)
commit9408b2428af090c1444765f915894390712a27ec
tree2d16e26af8ef6dede7dcdc5c1a6dd1af3b98616f
parent45b5a7203c4a27e4f3cde40bb929c43e3c962b2b
ipc: add sysctl to specify desired next object id

Add 3 new variables and sysctls to tune them (by one "next_id" variable
for messages, semaphores and shared memory respectively).  This variable
can be used to set desired id for next allocated IPC object.  By default
it's equal to -1 and old behaviour is preserved.  If this variable is
non-negative, then desired idr will be extracted from it and used as a
start value to search for free IDR slot.

Notes:

1) this patch doesn't guarantee that the new object will have desired
   id.  So it's up to user space how to handle new object with wrong id.

2) After a sucessful id allocation attempt, "next_id" will be set back
   to -1 (if it was non-negative).

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/ipc_namespace.h
ipc/ipc_sysctl.c
ipc/util.c
ipc/util.h