Skip to contentSkip to conversation

ipc/util.h: update documentation for ipc_getref() and ipc_putref()

PATCH New [email protected] 1 participant 1 message Jul 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 51/96 ipc/util.h: update documentation for ipc_getref() and ipc_putref()

From: Manfred Spraul <[email protected]>
Subject: 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().

---

 ipc/util.h |    3 +++
 1 file changed, 3 insertions(+)
ipc/util.h renamed from ipc/util.h~ipc-utilh-update-documentation-for-ipc_getref-and-ipc_putref +3 -0
diff -puN ipc/util.h~ipc-utilh-update-documentation-for-ipc_getref-and-ipc_putref ipc/util.h
@@ -112,6 +112,9 @@ int ipcperms(struct ipc_namespace *ns, s
  * 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,

_