mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
btrfs: use WARN_ON in a canonical form btrfs_remove_block_group
There is no point in using a construct like 'if (!condition) WARN_ON(1)'. Use WARN_ON(!condition) directly. No functional changes. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
260e77025f
commit
9a0ec83d57
@ -10869,13 +10869,10 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
|
|||||||
}
|
}
|
||||||
|
|
||||||
spin_lock(&trans->transaction->dirty_bgs_lock);
|
spin_lock(&trans->transaction->dirty_bgs_lock);
|
||||||
if (!list_empty(&block_group->dirty_list)) {
|
WARN_ON(!list_empty(&block_group->dirty_list));
|
||||||
WARN_ON(1);
|
WARN_ON(!list_empty(&block_group->io_list));
|
||||||
}
|
|
||||||
if (!list_empty(&block_group->io_list)) {
|
|
||||||
WARN_ON(1);
|
|
||||||
}
|
|
||||||
spin_unlock(&trans->transaction->dirty_bgs_lock);
|
spin_unlock(&trans->transaction->dirty_bgs_lock);
|
||||||
|
|
||||||
btrfs_remove_free_space_cache(block_group);
|
btrfs_remove_free_space_cache(block_group);
|
||||||
|
|
||||||
spin_lock(&block_group->space_info->lock);
|
spin_lock(&block_group->space_info->lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user