diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2014-11-20 08:42:02 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2014-11-20 08:42:02 -0500 |
| commit | a02001086bbfb4da35d1228bebc2f1b442db455f (patch) | |
| tree | 62ab47936cef06fd08657ca5b6cd1df98c19be57 /include/linux/seqlock.h | |
| parent | eff264efeeb0898408e8c9df72d8a32621035bed (diff) | |
| parent | fc14f9c1272f62c3e8d01300f52467c0d9af50f9 (diff) | |
Merge Linus' tree to be be to apply submitted patches to newer code than
current trivial.git base
Diffstat (limited to 'include/linux/seqlock.h')
| -rw-r--r-- | include/linux/seqlock.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cc359636cfa3..f5df8f687b4d 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -456,4 +456,23 @@ read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags) | |||
| 456 | spin_unlock_irqrestore(&sl->lock, flags); | 456 | spin_unlock_irqrestore(&sl->lock, flags); |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | static inline unsigned long | ||
| 460 | read_seqbegin_or_lock_irqsave(seqlock_t *lock, int *seq) | ||
| 461 | { | ||
| 462 | unsigned long flags = 0; | ||
| 463 | |||
| 464 | if (!(*seq & 1)) /* Even */ | ||
| 465 | *seq = read_seqbegin(lock); | ||
| 466 | else /* Odd */ | ||
| 467 | read_seqlock_excl_irqsave(lock, flags); | ||
| 468 | |||
| 469 | return flags; | ||
| 470 | } | ||
| 471 | |||
| 472 | static inline void | ||
| 473 | done_seqretry_irqrestore(seqlock_t *lock, int seq, unsigned long flags) | ||
| 474 | { | ||
| 475 | if (seq & 1) | ||
| 476 | read_sequnlock_excl_irqrestore(lock, flags); | ||
| 477 | } | ||
| 459 | #endif /* __LINUX_SEQLOCK_H */ | 478 | #endif /* __LINUX_SEQLOCK_H */ |
