summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/locking.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/locking.c
parentbtrfs: add assertion helpers for extent buffer write lock counters (diff)
downloadlinux-c79adfc085c0662385cfcb55f15590303212e8e9.tar.xz
linux-c79adfc085c0662385cfcb55f15590303212e8e9.zip
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/locking.c')
-rw-r--r--fs/btrfs/locking.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 1c9bb0620e4b..3f7b5989e31e 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -243,7 +243,7 @@ int btrfs_try_tree_write_lock(struct extent_buffer *eb)
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;
@@ -310,7 +310,7 @@ again:
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;
}
@@ -325,7 +325,7 @@ void btrfs_tree_unlock(struct extent_buffer *eb)
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);