On 2020/5/5 下午4:47, Johannes Thumshirn wrote:
> On 05/05/2020 01:58, Qu Wenruo wrote:
>> When deleting a block group item, it's pretty straight forward, just
>> delete the item pointed by the key.
>>
>> However it will not be that straight-forward for incoming skinny block
>> group item.
>>
>> So refactor the block group item deletion into a new function,
>> remove_block_group_item(), also to make the already lengthy
>> btrfs_remove_block_group() a little shorter.
>
> I think this patch is useful even without the skinny_bg feature.
>
>> +static int remove_block_group_item(struct btrfs_trans_handle *trans,
>> + struct btrfs_path *path,
>> + struct btrfs_block_group *block_group)
>> +{
>> + struct btrfs_fs_info *fs_info = trans->fs_info;
>> + struct btrfs_root *root;
>
> Tiny nitpick, why not:
>
> struct btrfs_root *root = fs_info->extent_root;
>
> Like it was in brtfs_remove_block_group()?
That's mostly for the skinny_bg_tree (6th) patch, as in that patch,
skinny_bg_tree feature goes to pick bg_root other than extent root.
So I didn't initialize root here, but leaves it assigned the same timing
as key.
Thanks,
Qu
>
> Anyways looks good to me,
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
>
Attachment:
signature.asc
Description: OpenPGP digital signature
