mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ipc: introduce obtaining a lockless ipc object
Through ipc_lock() and therefore ipc_lock_check() we currently return the locked ipc object. This is not necessary for all situations and can, therefore, cause unnecessary ipc lock contention. Introduce analogous ipc_obtain_object() and ipc_obtain_object_check() functions that only lookup and return the ipc object. Both these functions must be called within the RCU read critical section. [[email protected]: propagate the ipc_obtain_object() errno from ipc_lock()] Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: Rik van Riel <[email protected]> Reviewed-by: Chegu Vinod <[email protected]> Acked-by: Michel Lespinasse <[email protected]> Cc: Emmanuel Benisty <[email protected]> Cc: Jason Low <[email protected]> Cc: Peter Hurley <[email protected]> Cc: Stanislav Kinsbursky <[email protected]> Tested-by: Sedat Dilek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7bb4deff61
commit
4d2bff5eb8
2 changed files with 59 additions and 14 deletions
|
|
@ -123,6 +123,7 @@ void ipc_rcu_getref(void *ptr);
|
|||
void ipc_rcu_putref(void *ptr);
|
||||
|
||||
struct kern_ipc_perm *ipc_lock(struct ipc_ids *, int);
|
||||
struct kern_ipc_perm *ipc_obtain_object(struct ipc_ids *ids, int id);
|
||||
|
||||
void kernel_to_ipc64_perm(struct kern_ipc_perm *in, struct ipc64_perm *out);
|
||||
void ipc64_perm_to_ipc_perm(struct ipc64_perm *in, struct ipc_perm *out);
|
||||
|
|
@ -168,6 +169,7 @@ static inline void ipc_unlock(struct kern_ipc_perm *perm)
|
|||
}
|
||||
|
||||
struct kern_ipc_perm *ipc_lock_check(struct ipc_ids *ids, int id);
|
||||
struct kern_ipc_perm *ipc_obtain_object_check(struct ipc_ids *ids, int id);
|
||||
int ipcget(struct ipc_namespace *ns, struct ipc_ids *ids,
|
||||
struct ipc_ops *ops, struct ipc_params *params);
|
||||
void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
|
||||
|
|
|
|||
Loading…
Reference in a new issue