diff options
author | David Sterba <dsterba@suse.com> | 2018-08-24 14:56:28 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-04-29 19:02:20 +0200 |
commit | 843ccf9f46baff289946e897b11fd813de62d06f (patch) | |
tree | 6cd5a503bd2492124fe8fe4a463f5953d658df47 /fs/btrfs/extent_io.c | |
parent | btrfs: add assertion helpers for spinning writers (diff) | |
download | linux-843ccf9f46baff289946e897b11fd813de62d06f.tar.xz linux-843ccf9f46baff289946e897b11fd813de62d06f.zip |
btrfs: use assertion helpers for spinning writers
Use the helpers where open coded. On non-debug builds, the warnings will
not trigger and extent_buffer::spining_writers 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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index cc3941ae1ff6..fc0451c3e24e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4682,7 +4682,6 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start, atomic_set(&eb->blocking_readers, 0); atomic_set(&eb->blocking_writers, 0); atomic_set(&eb->spinning_readers, 0); - atomic_set(&eb->spinning_writers, 0); eb->lock_nested = 0; init_waitqueue_head(&eb->write_lock_wq); init_waitqueue_head(&eb->read_lock_wq); @@ -4700,6 +4699,10 @@ __alloc_extent_buffer(struct btrfs_fs_info *fs_info, u64 start, > MAX_INLINE_EXTENT_BUFFER_SIZE); BUG_ON(len > MAX_INLINE_EXTENT_BUFFER_SIZE); +#ifdef CONFIG_BTRFS_DEBUG + atomic_set(&eb->spinning_writers, 0); +#endif + return eb; } |