Skip to content

Commit 5326caa

Browse files
sjp38paulmckrcu
authored andcommitted
Docs/RCU/rculist_nulls: Specify type of the object in examples
The type of 'obj' in example code of rculist_nulls.rst is implicit. Provide the specific type of it before the example code. Suggested-by: Paul E. McKenney <[email protected]> Link: https://lore.kernel.org/rcu/43943609-f80c-4b6a-9844-994eef800757@paulmck-laptop/ Signed-off-by: SeongJae Park <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 674dd36 commit 5326caa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Documentation/RCU/rculist_nulls.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ to solve following problem.
1818

1919
Without 'nulls', a typical RCU linked list managing objects which are
2020
allocated with SLAB_TYPESAFE_BY_RCU kmem_cache can use the following
21-
algorithms:
21+
algorithms. Following examples assume 'obj' is a pointer to such
22+
objects, which is having below type.
23+
24+
::
25+
26+
struct object {
27+
struct hlist_node obj_node;
28+
atomic_t refcnt;
29+
unsigned int key;
30+
};
2231

2332
1) Lookup algorithm
2433
-------------------
@@ -144,6 +153,9 @@ the beginning. If the object was moved to the same chain,
144153
then the reader doesn't care: It might occasionally
145154
scan the list again without harm.
146155

156+
Note that using hlist_nulls means the type of 'obj_node' field of
157+
'struct object' becomes 'struct hlist_nulls_node'.
158+
147159

148160
1) lookup algorithm
149161
-------------------

0 commit comments

Comments
 (0)