mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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). [[email protected]: checkpatch fixes] Signed-off-by: Stanislav Kinsbursky <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Al Viro <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Michael Kerrisk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
9afdacda02
commit
03f5956680
5 changed files with 65 additions and 4 deletions
|
|
@ -92,6 +92,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
|
|||
#define IPC_SHM_IDS 2
|
||||
|
||||
#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
|
||||
#define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER)
|
||||
|
||||
/* must be called with ids->rw_mutex acquired for writing */
|
||||
int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);
|
||||
|
|
|
|||
Loading…
Reference in a new issue