dm vdo: rename vdo_map_to_system_error to vdo_status_to_errno

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
This commit is contained in:
Mike Snitzer 2024-01-26 21:42:29 -05:00
parent c10497b3b1
commit f7c1c2e085
4 changed files with 9 additions and 9 deletions

View File

@ -274,7 +274,7 @@ static void acknowledge_data_vio(struct data_vio *data_vio)
{
struct vdo *vdo = vdo_from_data_vio(data_vio);
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)
return;

View File

@ -1117,7 +1117,7 @@ static int vdo_message(struct dm_target *ti, unsigned int argc, char **argv,
vdo_write_stats(vdo, result_buffer, maxlen);
result = 1;
} 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();
@ -1613,7 +1613,7 @@ static int construct_new_vdo_registered(struct dm_target *ti, unsigned int argc,
if (result != VDO_SUCCESS) {
release_instance(instance);
free_device_config(config);
return vdo_map_to_system_error(result);
return vdo_status_to_errno(result);
}
return VDO_SUCCESS;
@ -1852,7 +1852,7 @@ static int prepare_to_modify(struct dm_target *ti, struct device_config *config,
if (result != VDO_SUCCESS) {
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.
*/
result = -EINVAL;
@ -1892,7 +1892,7 @@ static int update_existing_vdo(const char *device_name, struct dm_target *ti,
result = prepare_to_modify(ti, config, vdo);
if (result != VDO_SUCCESS) {
free_device_config(config);
return vdo_map_to_system_error(result);
return vdo_status_to_errno(result);
}
set_device_config(ti, vdo, config);
@ -2850,7 +2850,7 @@ static int vdo_preresume(struct dm_target *ti)
if ((result == VDO_PARAMETER_MISMATCH) || (result == VDO_INVALID_ADMIN_STATE))
result = -EINVAL;
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)

View File

@ -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.
*
* 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)
*
* 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_message[UDS_MAX_ERROR_MESSAGE_SIZE];

View File

@ -105,6 +105,6 @@ extern const struct error_info vdo_status_list[];
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 */