eb->fs_info = fs_info;
eb->bflags = 0;
rwlock_init(&eb->lock);
- atomic_set(&eb->write_locks, 0);
atomic_set(&eb->blocking_readers, 0);
atomic_set(&eb->blocking_writers, 0);
eb->lock_nested = 0;
atomic_set(&eb->spinning_writers, 0);
atomic_set(&eb->spinning_readers, 0);
atomic_set(&eb->read_locks, 0);
+ atomic_set(&eb->write_locks, 0);
#endif
return eb;
struct rcu_head rcu_head;
pid_t lock_owner;
- /* count of read lock holders on the extent buffer */
- atomic_t write_locks;
atomic_t blocking_writers;
atomic_t blocking_readers;
short lock_nested;
atomic_t spinning_writers;
atomic_t spinning_readers;
atomic_t read_locks;
+ atomic_t write_locks;
struct list_head leak_list;
#endif
};
write_unlock(&eb->lock);
return 0;
}
- atomic_inc(&eb->write_locks);
+ btrfs_assert_tree_write_locks_get(eb);
btrfs_assert_spinning_writers_get(eb);
eb->lock_owner = current->pid;
return 1;
goto again;
}
btrfs_assert_spinning_writers_get(eb);
- atomic_inc(&eb->write_locks);
+ btrfs_assert_tree_write_locks_get(eb);
eb->lock_owner = current->pid;
}
btrfs_assert_tree_locked(eb);
eb->lock_owner = 0;
- atomic_dec(&eb->write_locks);
+ btrfs_assert_tree_write_locks_put(eb);
if (blockers) {
btrfs_assert_no_spinning_writers(eb);