Merge tag 'mtd/fixes-for-4.19-rc5' of git://git.infradead.org/linux-mtd
[linux-2.6/btrfs-unstable.git] / include / asm-generic / qrwlock_types.h
blobc36f1d5a2572cdbc01106730a815637419acbf35
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_GENERIC_QRWLOCK_TYPES_H
3 #define __ASM_GENERIC_QRWLOCK_TYPES_H
5 #include <linux/types.h>
6 #include <asm/byteorder.h>
7 #include <asm/spinlock_types.h>
9 /*
10 * The queue read/write lock data structure
13 typedef struct qrwlock {
14 union {
15 atomic_t cnts;
16 struct {
17 #ifdef __LITTLE_ENDIAN
18 u8 wlocked; /* Locked for write? */
19 u8 __lstate[3];
20 #else
21 u8 __lstate[3];
22 u8 wlocked; /* Locked for write? */
23 #endif
26 arch_spinlock_t wait_lock;
27 } arch_rwlock_t;
29 #define __ARCH_RW_LOCK_UNLOCKED { \
30 { .cnts = ATOMIC_INIT(0), }, \
31 .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
34 #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */