Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: seqlock: s/LOCKTYPE/LOCKNAME/g

Sequence counters with an associated write serialization lock are called
seqcount_LOCKNAME_t. Fix the documentation accordingly.

While at it, remove a paragraph that inappropriately discussed a
seqlock.h implementation detail.

Fixes: 6dd699b13d53 ("seqlock: seqcount_LOCKNAME_t: Standardize naming convention")
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20201206162143.14387-2-a.darwish@linutronix.de

authored by

Ahmed S. Darwish and committed by
Peter Zijlstra
cf486472 617f3ef9

+10 -11
+10 -11
Documentation/locking/seqlock.rst
··· 89 89 90 90 .. _seqcount_locktype_t: 91 91 92 - Sequence counters with associated locks (``seqcount_LOCKTYPE_t``) 92 + Sequence counters with associated locks (``seqcount_LOCKNAME_t``) 93 93 ----------------------------------------------------------------- 94 94 95 95 As discussed at :ref:`seqcount_t`, sequence count write side critical ··· 115 115 - ``seqcount_mutex_t`` 116 116 - ``seqcount_ww_mutex_t`` 117 117 118 - The plain seqcount read and write APIs branch out to the specific 119 - seqcount_LOCKTYPE_t implementation at compile-time. This avoids kernel 120 - API explosion per each new seqcount LOCKTYPE. 118 + The sequence counter read and write APIs can take either a plain 119 + seqcount_t or any of the seqcount_LOCKNAME_t variants above. 121 120 122 - Initialization (replace "LOCKTYPE" with one of the supported locks):: 121 + Initialization (replace "LOCKNAME" with one of the supported locks):: 123 122 124 123 /* dynamic */ 125 - seqcount_LOCKTYPE_t foo_seqcount; 126 - seqcount_LOCKTYPE_init(&foo_seqcount, &lock); 124 + seqcount_LOCKNAME_t foo_seqcount; 125 + seqcount_LOCKNAME_init(&foo_seqcount, &lock); 127 126 128 127 /* static */ 129 - static seqcount_LOCKTYPE_t foo_seqcount = 130 - SEQCNT_LOCKTYPE_ZERO(foo_seqcount, &lock); 128 + static seqcount_LOCKNAME_t foo_seqcount = 129 + SEQCNT_LOCKNAME_ZERO(foo_seqcount, &lock); 131 130 132 131 /* C99 struct init */ 133 132 struct { 134 - .seq = SEQCNT_LOCKTYPE_ZERO(foo.seq, &lock), 133 + .seq = SEQCNT_LOCKNAME_ZERO(foo.seq, &lock), 135 134 } foo; 136 135 137 136 Write path: same as in :ref:`seqcount_t`, while running from a context 138 - with the associated LOCKTYPE lock acquired. 137 + with the associated write serialization lock acquired. 139 138 140 139 Read path: same as in :ref:`seqcount_t`. 141 140