summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/locking.c
diff options
context:
space:
mode:
authorDavid Sterba2019-05-02 16:53:47 +0200
committerDavid Sterba2019-07-02 12:30:47 +0200
commit00801ae4bb2be5f5af46502ef239ac5f4b536094 (patch)
treed9835c3f4d44ecc3c4aa15c3707c4aea1a243ee3 /fs/btrfs/locking.c
parentbtrfs: switch extent_buffer spinning_writers from atomic to int (diff)
downloadkernel-qcow2-linux-00801ae4bb2be5f5af46502ef239ac5f4b536094.tar.gz
kernel-qcow2-linux-00801ae4bb2be5f5af46502ef239ac5f4b536094.tar.xz
kernel-qcow2-linux-00801ae4bb2be5f5af46502ef239ac5f4b536094.zip
btrfs: switch extent_buffer write_locks from atomic to int
The write_locks is either 0 or 1 and always updated under the lock, so we don't need the atomic_t semantics. Reviewed-by: Nikolay Borisov <nborisov@suse.com> 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 270667627977..98fccce4208c 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -58,17 +58,17 @@ static void btrfs_assert_tree_read_locked(struct extent_buffer *eb)
static void btrfs_assert_tree_write_locks_get(struct extent_buffer *eb)
{
- atomic_inc(&eb->write_locks);
+ eb->write_locks++;
}
static void btrfs_assert_tree_write_locks_put(struct extent_buffer *eb)
{
- atomic_dec(&eb->write_locks);
+ eb->write_locks--;
}
void btrfs_assert_tree_locked(struct extent_buffer *eb)
{
- BUG_ON(!atomic_read(&eb->write_locks));
+ BUG_ON(!eb->write_locks);
}
#else