eb->bflags = 0;
rwlock_init(&eb->lock);
atomic_set(&eb->write_locks, 0);
- atomic_set(&eb->read_locks, 0);
atomic_set(&eb->blocking_readers, 0);
atomic_set(&eb->blocking_writers, 0);
eb->lock_nested = 0;
#ifdef CONFIG_BTRFS_DEBUG
atomic_set(&eb->spinning_writers, 0);
atomic_set(&eb->spinning_readers, 0);
+ atomic_set(&eb->read_locks, 0);
#endif
return eb;
/* count of read lock holders on the extent buffer */
atomic_t write_locks;
- atomic_t read_locks;
atomic_t blocking_writers;
atomic_t blocking_readers;
short lock_nested;
#ifdef CONFIG_BTRFS_DEBUG
atomic_t spinning_writers;
atomic_t spinning_readers;
+ atomic_t read_locks;
struct list_head leak_list;
#endif
};
atomic_read(&eb->blocking_writers) == 0);
goto again;
}
- atomic_inc(&eb->read_locks);
+ btrfs_assert_tree_read_locks_get(eb);
btrfs_assert_spinning_readers_get(eb);
}
read_unlock(&eb->lock);
return 0;
}
- atomic_inc(&eb->read_locks);
+ btrfs_assert_tree_read_locks_get(eb);
btrfs_assert_spinning_readers_get(eb);
return 1;
}
read_unlock(&eb->lock);
return 0;
}
- atomic_inc(&eb->read_locks);
+ btrfs_assert_tree_read_locks_get(eb);
btrfs_assert_spinning_readers_get(eb);
return 1;
}
}
btrfs_assert_tree_read_locked(eb);
btrfs_assert_spinning_readers_put(eb);
- atomic_dec(&eb->read_locks);
+ btrfs_assert_tree_read_locks_put(eb);
read_unlock(&eb->lock);
}
/* atomic_dec_and_test implies a barrier */
if (atomic_dec_and_test(&eb->blocking_readers))
cond_wake_up_nomb(&eb->read_lock_wq);
- atomic_dec(&eb->read_locks);
+ btrfs_assert_tree_read_locks_put(eb);
}
/*