summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-08-24 16:15:51 +0200
committerDavid Sterba <dsterba@suse.com>2019-04-29 19:02:21 +0200
commit5c9c799ab78336a4161b16126952a7e1320a8c77 (patch)
treec419a5edcab793e6ed655ace2cb53649262be61e /fs/btrfs/extent_io.c
parent58a2ddaedbf74b8a209426128c130cc9f0dbd11b (diff)
downloadlinux-5c9c799ab78336a4161b16126952a7e1320a8c77.tar.gz
linux-5c9c799ab78336a4161b16126952a7e1320a8c77.tar.bz2
linux-5c9c799ab78336a4161b16126952a7e1320a8c77.zip
btrfs: use assertion helpers for extent buffer read lock counters
Use the helpers where open coded. On non-debug builds, the warnings will not trigger and extent_buffer::read_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 f010475f74fd..c189b018ed69 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4678,7 +4678,6 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start,
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;
@@ -4701,6 +4700,7 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start,
#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;