@@ -138,51 +138,6 @@ static inline void seqcount_lockdep_reader_access(const seqcount_t *s)
138
138
#define __SEQ_LOCK (expr )
139
139
#endif
140
140
141
- #define SEQCOUNT_LOCKTYPE_ZERO (seq_name , assoc_lock ) { \
142
- .seqcount = SEQCNT_ZERO(seq_name.seqcount), \
143
- __SEQ_LOCK(.lock = (assoc_lock)) \
144
- }
145
-
146
- /**
147
- * SEQCNT_SPINLOCK_ZERO - static initializer for seqcount_spinlock_t
148
- * @name: Name of the seqcount_spinlock_t instance
149
- * @lock: Pointer to the associated spinlock
150
- */
151
- #define SEQCNT_SPINLOCK_ZERO (name , lock ) \
152
- SEQCOUNT_LOCKTYPE_ZERO(name, lock)
153
-
154
- /**
155
- * SEQCNT_RAW_SPINLOCK_ZERO - static initializer for seqcount_raw_spinlock_t
156
- * @name: Name of the seqcount_raw_spinlock_t instance
157
- * @lock: Pointer to the associated raw_spinlock
158
- */
159
- #define SEQCNT_RAW_SPINLOCK_ZERO (name , lock ) \
160
- SEQCOUNT_LOCKTYPE_ZERO(name, lock)
161
-
162
- /**
163
- * SEQCNT_RWLOCK_ZERO - static initializer for seqcount_rwlock_t
164
- * @name: Name of the seqcount_rwlock_t instance
165
- * @lock: Pointer to the associated rwlock
166
- */
167
- #define SEQCNT_RWLOCK_ZERO (name , lock ) \
168
- SEQCOUNT_LOCKTYPE_ZERO(name, lock)
169
-
170
- /**
171
- * SEQCNT_MUTEX_ZERO - static initializer for seqcount_mutex_t
172
- * @name: Name of the seqcount_mutex_t instance
173
- * @lock: Pointer to the associated mutex
174
- */
175
- #define SEQCNT_MUTEX_ZERO (name , lock ) \
176
- SEQCOUNT_LOCKTYPE_ZERO(name, lock)
177
-
178
- /**
179
- * SEQCNT_WW_MUTEX_ZERO - static initializer for seqcount_ww_mutex_t
180
- * @name: Name of the seqcount_ww_mutex_t instance
181
- * @lock: Pointer to the associated ww_mutex
182
- */
183
- #define SEQCNT_WW_MUTEX_ZERO (name , lock ) \
184
- SEQCOUNT_LOCKTYPE_ZERO(name, lock)
185
-
186
141
/**
187
142
* typedef seqcount_LOCKNAME_t - sequence counter with LOCKTYPR associated
188
143
* @seqcount: The real sequence counter
@@ -263,6 +218,24 @@ SEQCOUNT_LOCKTYPE(rwlock_t, rwlock, false, s->lock)
263
218
SEQCOUNT_LOCKTYPE (struct mutex , mutex , true, s -> lock )
264
219
SEQCOUNT_LOCKTYPE (struct ww_mutex , ww_mutex , true, & s -> lock -> base )
265
220
221
+ /**
222
+ * SEQCNT_LOCKNAME_ZERO - static initializer for seqcount_LOCKNAME_t
223
+ * @name: Name of the seqcount_LOCKNAME_t instance
224
+ * @lock: Pointer to the associated LOCKTYPE
225
+ */
226
+
227
+ #define SEQCOUNT_LOCKTYPE_ZERO (seq_name , assoc_lock ) { \
228
+ .seqcount = SEQCNT_ZERO(seq_name.seqcount), \
229
+ __SEQ_LOCK(.lock = (assoc_lock)) \
230
+ }
231
+
232
+ #define SEQCNT_SPINLOCK_ZERO (name , lock ) SEQCOUNT_LOCKTYPE_ZERO(name, lock)
233
+ #define SEQCNT_RAW_SPINLOCK_ZERO (name , lock ) SEQCOUNT_LOCKTYPE_ZERO(name, lock)
234
+ #define SEQCNT_RWLOCK_ZERO (name , lock ) SEQCOUNT_LOCKTYPE_ZERO(name, lock)
235
+ #define SEQCNT_MUTEX_ZERO (name , lock ) SEQCOUNT_LOCKTYPE_ZERO(name, lock)
236
+ #define SEQCNT_WW_MUTEX_ZERO (name , lock ) SEQCOUNT_LOCKTYPE_ZERO(name, lock)
237
+
238
+
266
239
#define __seqprop_case (s , lockname , prop ) \
267
240
seqcount_##lockname##_t: __seqcount_##lockname##_##prop((void *)(s))
268
241
0 commit comments