GNU Linux-libre 6.8.9-gnu
[releases.git] / fs / bcachefs / nocow_locking_types.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_NOCOW_LOCKING_TYPES_H
3 #define _BCACHEFS_NOCOW_LOCKING_TYPES_H
4
5 #define BUCKET_NOCOW_LOCKS_BITS         10
6 #define BUCKET_NOCOW_LOCKS              (1U << BUCKET_NOCOW_LOCKS_BITS)
7
8 struct nocow_lock_bucket {
9         struct closure_waitlist         wait;
10         spinlock_t                      lock;
11         u64                             b[4];
12         atomic_t                        l[4];
13 } __aligned(SMP_CACHE_BYTES);
14
15 struct bucket_nocow_lock_table {
16         struct nocow_lock_bucket        l[BUCKET_NOCOW_LOCKS];
17 };
18
19 #endif /* _BCACHEFS_NOCOW_LOCKING_TYPES_H */
20