summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2017-07-12 14:35:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-12 16:26:02 -0700
commit62b49c9908bcee88347efe8b4ed1b4f53c60ee66 (patch)
tree2285e34d091f10b492c8d1741aeef6c5a1afd472 /ipc
parente2029dfeef7b09f08ac8572e8be3d4c624d1f79a (diff)
downloadop-kernel-dev-62b49c9908bcee88347efe8b4ed1b4f53c60ee66.zip
op-kernel-dev-62b49c9908bcee88347efe8b4ed1b4f53c60ee66.tar.gz
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipc/util.h b/ipc/util.h
index 77336c2b..c692010 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,
OpenPOWER on IntegriCloud