summaryrefslogtreecommitdiff
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-07-15 22:45:25 +0300
committerDavid Sterba <dsterba@suse.com>2022-09-26 13:27:54 +0300
commit9283b9e09a6d4c0150c33b5674d5071234218c99 (patch)
tree03cf1e7cc25df6d5bbf8369c9af4fd2c410e811a /fs/btrfs/dev-replace.c
parent3349b57fd47b5de10936bd8928db546b20c9fb91 (diff)
downloadlinux-9283b9e09a6d4c0150c33b5674d5071234218c99.tar.xz
btrfs: remove lock protection for BLOCK_GROUP_FLAG_TO_COPY
We use this during device replace for zoned devices, we were simply taking the lock because it was in a bit field and we needed the lock to be safe with other modifications in the bitfield. With the bit helpers we no longer require that locking. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r--fs/btrfs/dev-replace.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 46b608260b33..88b2c256dc83 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -545,10 +545,7 @@ static int mark_block_group_to_copy(struct btrfs_fs_info *fs_info,
if (!cache)
continue;
- spin_lock(&cache->lock);
set_bit(BLOCK_GROUP_FLAG_TO_COPY, &cache->runtime_flags);
- spin_unlock(&cache->lock);
-
btrfs_put_block_group(cache);
}
if (iter_ret < 0)
@@ -610,9 +607,7 @@ bool btrfs_finish_block_group_to_copy(struct btrfs_device *srcdev,
}
/* Last stripe on this device */
- spin_lock(&cache->lock);
clear_bit(BLOCK_GROUP_FLAG_TO_COPY, &cache->runtime_flags);
- spin_unlock(&cache->lock);
return true;
}