|
@@ -6358,6 +6358,7 @@ static int update_block_group(struct btrfs_trans_handle *trans,
|
|
spin_lock(&info->unused_bgs_lock);
|
|
spin_lock(&info->unused_bgs_lock);
|
|
if (list_empty(&cache->bg_list)) {
|
|
if (list_empty(&cache->bg_list)) {
|
|
btrfs_get_block_group(cache);
|
|
btrfs_get_block_group(cache);
|
|
|
|
+ trace_btrfs_add_unused_block_group(cache);
|
|
list_add_tail(&cache->bg_list,
|
|
list_add_tail(&cache->bg_list,
|
|
&info->unused_bgs);
|
|
&info->unused_bgs);
|
|
}
|
|
}
|
|
@@ -10192,6 +10193,7 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
|
|
/* Should always be true but just in case. */
|
|
/* Should always be true but just in case. */
|
|
if (list_empty(&cache->bg_list)) {
|
|
if (list_empty(&cache->bg_list)) {
|
|
btrfs_get_block_group(cache);
|
|
btrfs_get_block_group(cache);
|
|
|
|
+ trace_btrfs_add_unused_block_group(cache);
|
|
list_add_tail(&cache->bg_list,
|
|
list_add_tail(&cache->bg_list,
|
|
&info->unused_bgs);
|
|
&info->unused_bgs);
|
|
}
|
|
}
|
|
@@ -10379,6 +10381,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
|
|
BUG_ON(!block_group);
|
|
BUG_ON(!block_group);
|
|
BUG_ON(!block_group->ro);
|
|
BUG_ON(!block_group->ro);
|
|
|
|
|
|
|
|
+ trace_btrfs_remove_block_group(block_group);
|
|
/*
|
|
/*
|
|
* Free the reserved super bytes from this block group before
|
|
* Free the reserved super bytes from this block group before
|
|
* remove it.
|
|
* remove it.
|
|
@@ -10743,6 +10746,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
|
|
* the ro check in case balance is currently acting on
|
|
* the ro check in case balance is currently acting on
|
|
* this block group.
|
|
* this block group.
|
|
*/
|
|
*/
|
|
|
|
+ trace_btrfs_skip_unused_block_group(block_group);
|
|
spin_unlock(&block_group->lock);
|
|
spin_unlock(&block_group->lock);
|
|
up_write(&space_info->groups_sem);
|
|
up_write(&space_info->groups_sem);
|
|
goto next;
|
|
goto next;
|