diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-05-11 09:17:46 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:25:58 +0200 |
commit | a5ed45f8224f2c7e4ad5a9673cb50e8e3128bd88 (patch) | |
tree | 0fe59f8adb887bfab495948f2d7278c16daea491 /fs/btrfs/disk-io.c | |
parent | 401b41e5a85a635fd9888ba8969c5006a5dbd399 (diff) | |
download | linux-stable-a5ed45f8224f2c7e4ad5a9673cb50e8e3128bd88.tar.gz linux-stable-a5ed45f8224f2c7e4ad5a9673cb50e8e3128bd88.tar.bz2 linux-stable-a5ed45f8224f2c7e4ad5a9673cb50e8e3128bd88.zip |
btrfs: Convert fs_info->free_chunk_space to atomic64_t
The ->free_chunk_space variable is used to track the unallocated space
and access to it is protected by a spinlock, which is not used for
anything else. Make the code a bit self-explanatory by switching the
variable to an atomic64_t type and kill the spinlock.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
[ not a performance critical code, use of atomic type is ok ]
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index bafdd2fe8f88..9b8df5aaf76e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2626,7 +2626,6 @@ int open_ctree(struct super_block *sb, spin_lock_init(&fs_info->fs_roots_radix_lock); spin_lock_init(&fs_info->delayed_iput_lock); spin_lock_init(&fs_info->defrag_inodes_lock); - spin_lock_init(&fs_info->free_chunk_lock); spin_lock_init(&fs_info->tree_mod_seq_lock); spin_lock_init(&fs_info->super_lock); spin_lock_init(&fs_info->qgroup_op_lock); @@ -2667,7 +2666,7 @@ int open_ctree(struct super_block *sb, fs_info->max_inline = BTRFS_DEFAULT_MAX_INLINE; fs_info->metadata_ratio = 0; fs_info->defrag_inodes = RB_ROOT; - fs_info->free_chunk_space = 0; + atomic64_set(&fs_info->free_chunk_space, 0); fs_info->tree_mod_log = RB_ROOT; fs_info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL; fs_info->avg_delayed_ref_runtime = NSEC_PER_SEC >> 6; /* div by 64 */ |