On 2019/1/23 上午12:32, David Sterba wrote:
> On Tue, Jan 15, 2019 at 04:16:00PM +0800, Qu Wenruo wrote:
>> And to co-operate this, also delayed btrfs_drop_snapshot() call on reloc
>> tree, btrfs_drop_snapshot() call will also be delayed to
>> clean_dirty_subvs().
>
> Can you please rephrase this paragraph?
>
>> This patch will increase the size of btrfs_root by 16 bytes.
>>
>> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
>
>> +static int clean_dirty_subvs(struct reloc_control *rc)
>> +{
>> + struct btrfs_root *root;
>> + struct btrfs_root *next;
>> + int err = 0;
>> + int ret;
>> +
>> + list_for_each_entry_safe(root, next, &rc->dirty_subv_roots,
>> + reloc_dirty_list) {
>> + struct btrfs_root *reloc_root = root->reloc_root;
>> +
>> + clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
>> + list_del_init(&root->reloc_dirty_list);
>> + root->reloc_root = NULL;
>> + if (reloc_root) {
>> + ret = btrfs_drop_snapshot(reloc_root, NULL, 0, 1);
>> + if (ret < 0 && !err)
>> + err = ret;
>> + }
>> + btrfs_put_fs_root(root);
>> + }
>> + return err;
>
> Please dont use the err/ret style but 'ret' that matches function return
> type and for the temporary return values ret2 etc.
For this policy, the primary objective is to avoid the confusion between
err and ret, right?
Then I'd prefer tmp_ret over ret2, although it's just a personal taste.
Thanks,
Qu
>
>> +}
Attachment:
signature.asc
Description: OpenPGP digital signature
