On 2/6/20 5:42 AM, Naohiro Aota wrote:
Factor out create_chunk() from __btrfs_alloc_chunk(). This function finally
creates a chunk. There is no functional changes.
Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx>
<snip>
+
+ ctl.start = start;
+ ctl.type = type;
+ set_parameters(fs_devices, &ctl);
+
+ devices_info = kcalloc(fs_devices->rw_devices, sizeof(*devices_info),
+ GFP_NOFS);
+ if (!devices_info)
+ return -ENOMEM;
+
+ ret = gather_device_info(fs_devices, &ctl, devices_info);
+ if (ret < 0)
+ goto error;
+
+ ret = decide_stripe_size(fs_devices, &ctl, devices_info);
+ if (ret < 0)
+ goto error;
+
+ ret = create_chunk(trans, &ctl, devices_info);
+ if (ret < 0)
+ goto error;
+
This can just be
out:
kfree(devcies_info);
return ret;
and all the above people can just do goto out on error and we can drop the
error: part below. Thanks,
Josef