summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-08-24 16:24:26 +0200
committerDavid Sterba <dsterba@suse.com>2019-04-29 19:02:21 +0200
commitc79adfc085c0662385cfcb55f15590303212e8e9 (patch)
tree56de865729349310e8e70178deb57a392104a757 /fs/btrfs/extent_io.c
parente3f153886702302482918a3788ba3bb24a37a4aa (diff)
downloadlinux-c79adfc085c0662385cfcb55f15590303212e8e9.tar.bz2
btrfs: use assertion helpers for extent buffer write lock counters
Use the helpers where open coded. On non-debug builds, the warnings will not trigger and extent_buffer::write_locks become unused and can be moved to the appropriate section, saving a few bytes. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index c189b018ed69..97d32b80060d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4677,7 +4677,6 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start,
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;
@@ -4701,6 +4700,7 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start,
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;