aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index b5f120cca916..21a7ca9e7282 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -128,14 +128,26 @@ struct extent_buffer {
128 struct rcu_head rcu_head; 128 struct rcu_head rcu_head;
129 atomic_t refs; 129 atomic_t refs;
130 130
131 /* the spinlock is used to protect most operations */ 131 /* count of read lock holders on the extent buffer */
132 spinlock_t lock; 132 atomic_t write_locks;
133 atomic_t read_locks;
134 atomic_t blocking_writers;
135 atomic_t blocking_readers;
136 atomic_t spinning_readers;
137 atomic_t spinning_writers;
138
139 /* protects write locks */
140 rwlock_t lock;
141
142 /* readers use lock_wq while they wait for the write
143 * lock holders to unlock
144 */
145 wait_queue_head_t write_lock_wq;
133 146
134 /* 147 /* writers use read_lock_wq while they wait for readers
135 * when we keep the lock held while blocking, waiters go onto 148 * to unlock
136 * the wq
137 */ 149 */
138 wait_queue_head_t lock_wq; 150 wait_queue_head_t read_lock_wq;
139}; 151};
140 152
141static inline void extent_set_compress_type(unsigned long *bio_flags, 153static inline void extent_set_compress_type(unsigned long *bio_flags,