diff options
author | Manfred Spraul <manfred@colorfullife.com> | 2017-05-26 11:32:31 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-26 11:32:31 +1000 |
commit | 6175801d4cefbc4d15e5bb03d76fe86ede27d8bc (patch) | |
tree | 8995510c448702c9d379e143e0c246b0aebc2972 | |
parent | 38070a16c74181ce5d3e778201364a0a4a539012 (diff) |
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 <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | ipc/util.h | 3 |
1 files changed, 3 insertions, 0 deletions
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, |