提交 c83b60c0 编写于 作者: A Anand Jain 提交者: David Sterba

btrfs: simplify gotos in open_seed_device

The function does not have a common exit block and returns immediatelly
so there's no point having the goto. Remove the two cases.
Reviewed-by: NNikolay Borisov <nborisov@suse.com>
Signed-off-by: NAnand Jain <anand.jain@oracle.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 e493e8f9
...@@ -6753,19 +6753,17 @@ static struct btrfs_fs_devices *open_seed_devices(struct btrfs_fs_info *fs_info, ...@@ -6753,19 +6753,17 @@ static struct btrfs_fs_devices *open_seed_devices(struct btrfs_fs_info *fs_info,
ret = open_fs_devices(fs_devices, FMODE_READ, fs_info->bdev_holder); ret = open_fs_devices(fs_devices, FMODE_READ, fs_info->bdev_holder);
if (ret) { if (ret) {
free_fs_devices(fs_devices); free_fs_devices(fs_devices);
fs_devices = ERR_PTR(ret); return ERR_PTR(ret);
goto out;
} }
if (!fs_devices->seeding) { if (!fs_devices->seeding) {
close_fs_devices(fs_devices); close_fs_devices(fs_devices);
free_fs_devices(fs_devices); free_fs_devices(fs_devices);
fs_devices = ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
goto out;
} }
list_add(&fs_devices->seed_list, &fs_info->fs_devices->seed_list); list_add(&fs_devices->seed_list, &fs_info->fs_devices->seed_list);
out:
return fs_devices; return fs_devices;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册