From: Manfred Spraul Date: Wed, 12 Jul 2017 21:35:34 +0000 (-0700) Subject: ipc/util.h: update documentation for ipc_getref() and ipc_putref() X-Git-Tag: MMI-PSA29.97-13-9~5165^2~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62b49c9908bcee88347efe8b4ed1b4f53c60ee66;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ipc/util.h: update documentation for ipc_getref() and ipc_putref() Now that ipc_rcu_alloc() and ipc_rcu_free() are removed, document when it is valid to use ipc_getref() and ipc_putref(). Link: http://lkml.kernel.org/r/20170525185107.12869-21-manfred@colorfullife.com Signed-off-by: Manfred Spraul Cc: Davidlohr Bueso Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/ipc/util.h b/ipc/util.h index 77336c2bdb9c..c692010e6f0a 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -112,6 +112,9 @@ int ipcperms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp, short flg); * Objects are reference counted, they start with reference count 1. * getref increases the refcount, the putref call that reduces the recount * to 0 schedules the rcu destruction. Caller must guarantee locking. + * + * refcount is initialized by ipc_addid(), before that point call_rcu() + * must be used. */ int ipc_rcu_getref(struct kern_ipc_perm *ptr); void ipc_rcu_putref(struct kern_ipc_perm *ptr,