Skip to content

Commit d03b710

Browse files
a-darwishgregkh
authored andcommitted
Documentation: seqlock: s/LOCKTYPE/LOCKNAME/g
commit cf48647 upstream. 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: 6dd699b ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 29563a7 commit d03b710

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

‎Documentation/locking/seqlock.rst‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Read path::
8989

9090
.. _seqcount_locktype_t:
9191

92-
Sequence counters with associated locks (``seqcount_LOCKTYPE_t``)
92+
Sequence counters with associated locks (``seqcount_LOCKNAME_t``)
9393
-----------------------------------------------------------------
9494

9595
As discussed at :ref:`seqcount_t`, sequence count write side critical
@@ -115,27 +115,26 @@ The following sequence counters with associated locks are defined:
115115
- ``seqcount_mutex_t``
116116
- ``seqcount_ww_mutex_t``
117117

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.
121120

122-
Initialization (replace "LOCKTYPE" with one of the supported locks)::
121+
Initialization (replace "LOCKNAME" with one of the supported locks)::
123122

124123
/* 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);
127126

128127
/* 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);
131130

132131
/* C99 struct init */
133132
struct {
134-
.seq = SEQCNT_LOCKTYPE_ZERO(foo.seq, &lock),
133+
.seq = SEQCNT_LOCKNAME_ZERO(foo.seq, &lock),
135134
} foo;
136135

137136
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.
139138

140139
Read path: same as in :ref:`seqcount_t`.
141140

0 commit comments

Comments
 (0)