Commit f7c1c2e0 authored by Mike Snitzer's avatar Mike Snitzer

dm vdo: rename vdo_map_to_system_error to vdo_status_to_errno

Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarSusan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
parent c10497b3
...@@ -274,7 +274,7 @@ static void acknowledge_data_vio(struct data_vio *data_vio) ...@@ -274,7 +274,7 @@ static void acknowledge_data_vio(struct data_vio *data_vio)
{ {
struct vdo *vdo = vdo_from_data_vio(data_vio); struct vdo *vdo = vdo_from_data_vio(data_vio);
struct bio *bio = data_vio->user_bio; struct bio *bio = data_vio->user_bio;
int error = vdo_map_to_system_error(data_vio->vio.completion.result); int error = vdo_status_to_errno(data_vio->vio.completion.result);
if (bio == NULL) if (bio == NULL)
return; return;
......
...@@ -1117,7 +1117,7 @@ static int vdo_message(struct dm_target *ti, unsigned int argc, char **argv, ...@@ -1117,7 +1117,7 @@ static int vdo_message(struct dm_target *ti, unsigned int argc, char **argv,
vdo_write_stats(vdo, result_buffer, maxlen); vdo_write_stats(vdo, result_buffer, maxlen);
result = 1; result = 1;
} else { } else {
result = vdo_map_to_system_error(process_vdo_message(vdo, argc, argv)); result = vdo_status_to_errno(process_vdo_message(vdo, argc, argv));
} }
uds_unregister_thread_device_id(); uds_unregister_thread_device_id();
...@@ -1613,7 +1613,7 @@ static int construct_new_vdo_registered(struct dm_target *ti, unsigned int argc, ...@@ -1613,7 +1613,7 @@ static int construct_new_vdo_registered(struct dm_target *ti, unsigned int argc,
if (result != VDO_SUCCESS) { if (result != VDO_SUCCESS) {
release_instance(instance); release_instance(instance);
free_device_config(config); free_device_config(config);
return vdo_map_to_system_error(result); return vdo_status_to_errno(result);
} }
return VDO_SUCCESS; return VDO_SUCCESS;
...@@ -1852,7 +1852,7 @@ static int prepare_to_modify(struct dm_target *ti, struct device_config *config, ...@@ -1852,7 +1852,7 @@ static int prepare_to_modify(struct dm_target *ti, struct device_config *config,
if (result != VDO_SUCCESS) { if (result != VDO_SUCCESS) {
if (result == VDO_PARAMETER_MISMATCH) { if (result == VDO_PARAMETER_MISMATCH) {
/* /*
* If we don't trap this case, vdo_map_to_system_error() will remap * If we don't trap this case, vdo_status_to_errno() will remap
* it to -EIO, which is misleading and ahistorical. * it to -EIO, which is misleading and ahistorical.
*/ */
result = -EINVAL; result = -EINVAL;
...@@ -1892,7 +1892,7 @@ static int update_existing_vdo(const char *device_name, struct dm_target *ti, ...@@ -1892,7 +1892,7 @@ static int update_existing_vdo(const char *device_name, struct dm_target *ti,
result = prepare_to_modify(ti, config, vdo); result = prepare_to_modify(ti, config, vdo);
if (result != VDO_SUCCESS) { if (result != VDO_SUCCESS) {
free_device_config(config); free_device_config(config);
return vdo_map_to_system_error(result); return vdo_status_to_errno(result);
} }
set_device_config(ti, vdo, config); set_device_config(ti, vdo, config);
...@@ -2850,7 +2850,7 @@ static int vdo_preresume(struct dm_target *ti) ...@@ -2850,7 +2850,7 @@ static int vdo_preresume(struct dm_target *ti)
if ((result == VDO_PARAMETER_MISMATCH) || (result == VDO_INVALID_ADMIN_STATE)) if ((result == VDO_PARAMETER_MISMATCH) || (result == VDO_INVALID_ADMIN_STATE))
result = -EINVAL; result = -EINVAL;
uds_unregister_thread_device_id(); uds_unregister_thread_device_id();
return vdo_map_to_system_error(result); return vdo_status_to_errno(result);
} }
static void vdo_resume(struct dm_target *ti) static void vdo_resume(struct dm_target *ti)
......
...@@ -87,7 +87,7 @@ int vdo_register_status_codes(void) ...@@ -87,7 +87,7 @@ int vdo_register_status_codes(void)
} }
/** /**
* vdo_map_to_system_error() - Given an error code, return a value we can return to the OS. * vdo_status_to_errno() - Given an error code, return a value we can return to the OS.
* @error: The error code to convert. * @error: The error code to convert.
* *
* The input error code may be a system-generated value (such as -EIO), an errno macro used in our * The input error code may be a system-generated value (such as -EIO), an errno macro used in our
...@@ -96,7 +96,7 @@ int vdo_register_status_codes(void) ...@@ -96,7 +96,7 @@ int vdo_register_status_codes(void)
* *
* Return: A system error code value. * Return: A system error code value.
*/ */
int vdo_map_to_system_error(int error) int vdo_status_to_errno(int error)
{ {
char error_name[UDS_MAX_ERROR_NAME_SIZE]; char error_name[UDS_MAX_ERROR_NAME_SIZE];
char error_message[UDS_MAX_ERROR_MESSAGE_SIZE]; char error_message[UDS_MAX_ERROR_MESSAGE_SIZE];
......
...@@ -105,6 +105,6 @@ extern const struct error_info vdo_status_list[]; ...@@ -105,6 +105,6 @@ extern const struct error_info vdo_status_list[];
int vdo_register_status_codes(void); int vdo_register_status_codes(void);
int vdo_map_to_system_error(int error); int vdo_status_to_errno(int error);
#endif /* VDO_STATUS_CODES_H */ #endif /* VDO_STATUS_CODES_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment