Skip to content

Commit b5e6a02

Browse files
author
Peter Zijlstra
committed
seqcount: More consistent seqprop names
Attempt uniformity and brevity. Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
1 parent 0efc94c commit b5e6a02

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

include/linux/seqlock.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ SEQCOUNT_LOCKTYPE(struct ww_mutex, ww_mutex, true, &s->lock->base)
247247
__seqprop_case((s), mutex, prop), \
248248
__seqprop_case((s), ww_mutex, prop))
249249

250-
#define __to_seqcount_t(s) __seqprop(s, ptr)
251-
#define __associated_lock_exists_and_is_preemptible(s) __seqprop(s, preemptible)
252-
#define __assert_write_section_is_protected(s) __seqprop(s, assert)
250+
#define __seqcount_ptr(s) __seqprop(s, ptr)
251+
#define __seqcount_lock_preemptible(s) __seqprop(s, preemptible)
252+
#define __seqcount_assert_lock_held(s) __seqprop(s, assert)
253253

254254
/**
255255
* __read_seqcount_begin() - begin a seqcount_t read section w/o barrier
@@ -266,7 +266,7 @@ SEQCOUNT_LOCKTYPE(struct ww_mutex, ww_mutex, true, &s->lock->base)
266266
* Return: count to be passed to read_seqcount_retry()
267267
*/
268268
#define __read_seqcount_begin(s) \
269-
__read_seqcount_t_begin(__to_seqcount_t(s))
269+
__read_seqcount_t_begin(__seqcount_ptr(s))
270270

271271
static inline unsigned __read_seqcount_t_begin(const seqcount_t *s)
272272
{
@@ -289,7 +289,7 @@ static inline unsigned __read_seqcount_t_begin(const seqcount_t *s)
289289
* Return: count to be passed to read_seqcount_retry()
290290
*/
291291
#define raw_read_seqcount_begin(s) \
292-
raw_read_seqcount_t_begin(__to_seqcount_t(s))
292+
raw_read_seqcount_t_begin(__seqcount_ptr(s))
293293

294294
static inline unsigned raw_read_seqcount_t_begin(const seqcount_t *s)
295295
{
@@ -305,7 +305,7 @@ static inline unsigned raw_read_seqcount_t_begin(const seqcount_t *s)
305305
* Return: count to be passed to read_seqcount_retry()
306306
*/
307307
#define read_seqcount_begin(s) \
308-
read_seqcount_t_begin(__to_seqcount_t(s))
308+
read_seqcount_t_begin(__seqcount_ptr(s))
309309

310310
static inline unsigned read_seqcount_t_begin(const seqcount_t *s)
311311
{
@@ -325,7 +325,7 @@ static inline unsigned read_seqcount_t_begin(const seqcount_t *s)
325325
* Return: count to be passed to read_seqcount_retry()
326326
*/
327327
#define raw_read_seqcount(s) \
328-
raw_read_seqcount_t(__to_seqcount_t(s))
328+
raw_read_seqcount_t(__seqcount_ptr(s))
329329

330330
static inline unsigned raw_read_seqcount_t(const seqcount_t *s)
331331
{
@@ -353,7 +353,7 @@ static inline unsigned raw_read_seqcount_t(const seqcount_t *s)
353353
* Return: count to be passed to read_seqcount_retry()
354354
*/
355355
#define raw_seqcount_begin(s) \
356-
raw_seqcount_t_begin(__to_seqcount_t(s))
356+
raw_seqcount_t_begin(__seqcount_ptr(s))
357357

358358
static inline unsigned raw_seqcount_t_begin(const seqcount_t *s)
359359
{
@@ -380,7 +380,7 @@ static inline unsigned raw_seqcount_t_begin(const seqcount_t *s)
380380
* Return: true if a read section retry is required, else false
381381
*/
382382
#define __read_seqcount_retry(s, start) \
383-
__read_seqcount_t_retry(__to_seqcount_t(s), start)
383+
__read_seqcount_t_retry(__seqcount_ptr(s), start)
384384

385385
static inline int __read_seqcount_t_retry(const seqcount_t *s, unsigned start)
386386
{
@@ -400,7 +400,7 @@ static inline int __read_seqcount_t_retry(const seqcount_t *s, unsigned start)
400400
* Return: true if a read section retry is required, else false
401401
*/
402402
#define read_seqcount_retry(s, start) \
403-
read_seqcount_t_retry(__to_seqcount_t(s), start)
403+
read_seqcount_t_retry(__seqcount_ptr(s), start)
404404

405405
static inline int read_seqcount_t_retry(const seqcount_t *s, unsigned start)
406406
{
@@ -414,10 +414,10 @@ static inline int read_seqcount_t_retry(const seqcount_t *s, unsigned start)
414414
*/
415415
#define raw_write_seqcount_begin(s) \
416416
do { \
417-
if (__associated_lock_exists_and_is_preemptible(s)) \
417+
if (__seqcount_lock_preemptible(s)) \
418418
preempt_disable(); \
419419
\
420-
raw_write_seqcount_t_begin(__to_seqcount_t(s)); \
420+
raw_write_seqcount_t_begin(__seqcount_ptr(s)); \
421421
} while (0)
422422

423423
static inline void raw_write_seqcount_t_begin(seqcount_t *s)
@@ -433,9 +433,9 @@ static inline void raw_write_seqcount_t_begin(seqcount_t *s)
433433
*/
434434
#define raw_write_seqcount_end(s) \
435435
do { \
436-
raw_write_seqcount_t_end(__to_seqcount_t(s)); \
436+
raw_write_seqcount_t_end(__seqcount_ptr(s)); \
437437
\
438-
if (__associated_lock_exists_and_is_preemptible(s)) \
438+
if (__seqcount_lock_preemptible(s)) \
439439
preempt_enable(); \
440440
} while (0)
441441

@@ -456,12 +456,12 @@ static inline void raw_write_seqcount_t_end(seqcount_t *s)
456456
*/
457457
#define write_seqcount_begin_nested(s, subclass) \
458458
do { \
459-
__assert_write_section_is_protected(s); \
459+
__seqcount_assert_lock_held(s); \
460460
\
461-
if (__associated_lock_exists_and_is_preemptible(s)) \
461+
if (__seqcount_lock_preemptible(s)) \
462462
preempt_disable(); \
463463
\
464-
write_seqcount_t_begin_nested(__to_seqcount_t(s), subclass); \
464+
write_seqcount_t_begin_nested(__seqcount_ptr(s), subclass); \
465465
} while (0)
466466

467467
static inline void write_seqcount_t_begin_nested(seqcount_t *s, int subclass)
@@ -483,12 +483,12 @@ static inline void write_seqcount_t_begin_nested(seqcount_t *s, int subclass)
483483
*/
484484
#define write_seqcount_begin(s) \
485485
do { \
486-
__assert_write_section_is_protected(s); \
486+
__seqcount_assert_lock_held(s); \
487487
\
488-
if (__associated_lock_exists_and_is_preemptible(s)) \
488+
if (__seqcount_lock_preemptible(s)) \
489489
preempt_disable(); \
490490
\
491-
write_seqcount_t_begin(__to_seqcount_t(s)); \
491+
write_seqcount_t_begin(__seqcount_ptr(s)); \
492492
} while (0)
493493

494494
static inline void write_seqcount_t_begin(seqcount_t *s)
@@ -504,9 +504,9 @@ static inline void write_seqcount_t_begin(seqcount_t *s)
504504
*/
505505
#define write_seqcount_end(s) \
506506
do { \
507-
write_seqcount_t_end(__to_seqcount_t(s)); \
507+
write_seqcount_t_end(__seqcount_ptr(s)); \
508508
\
509-
if (__associated_lock_exists_and_is_preemptible(s)) \
509+
if (__seqcount_lock_preemptible(s)) \
510510
preempt_enable(); \
511511
} while (0)
512512

@@ -558,7 +558,7 @@ static inline void write_seqcount_t_end(seqcount_t *s)
558558
* }
559559
*/
560560
#define raw_write_seqcount_barrier(s) \
561-
raw_write_seqcount_t_barrier(__to_seqcount_t(s))
561+
raw_write_seqcount_t_barrier(__seqcount_ptr(s))
562562

563563
static inline void raw_write_seqcount_t_barrier(seqcount_t *s)
564564
{
@@ -578,7 +578,7 @@ static inline void raw_write_seqcount_t_barrier(seqcount_t *s)
578578
* will complete successfully and see data older than this.
579579
*/
580580
#define write_seqcount_invalidate(s) \
581-
write_seqcount_t_invalidate(__to_seqcount_t(s))
581+
write_seqcount_t_invalidate(__seqcount_ptr(s))
582582

583583
static inline void write_seqcount_t_invalidate(seqcount_t *s)
584584
{
@@ -604,7 +604,7 @@ static inline void write_seqcount_t_invalidate(seqcount_t *s)
604604
* checked with read_seqcount_retry().
605605
*/
606606
#define raw_read_seqcount_latch(s) \
607-
raw_read_seqcount_t_latch(__to_seqcount_t(s))
607+
raw_read_seqcount_t_latch(__seqcount_ptr(s))
608608

609609
static inline int raw_read_seqcount_t_latch(seqcount_t *s)
610610
{
@@ -695,7 +695,7 @@ static inline int raw_read_seqcount_t_latch(seqcount_t *s)
695695
* patterns to manage the lifetimes of the objects within.
696696
*/
697697
#define raw_write_seqcount_latch(s) \
698-
raw_write_seqcount_t_latch(__to_seqcount_t(s))
698+
raw_write_seqcount_t_latch(__seqcount_ptr(s))
699699

700700
static inline void raw_write_seqcount_t_latch(seqcount_t *s)
701701
{

0 commit comments

Comments
 (0)