Commit c10497b3 authored by Mike Snitzer's avatar Mike Snitzer

dm vdo: rename uds_map_to_system_error to uds_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 86492a3f
...@@ -219,7 +219,7 @@ const char *uds_string_error_name(int errnum, char *buf, size_t buflen) ...@@ -219,7 +219,7 @@ const char *uds_string_error_name(int errnum, char *buf, size_t buflen)
* system-generated value (such as -EIO), or an internal UDS status code. The result will be a * system-generated value (such as -EIO), or an internal UDS status code. The result will be a
* negative errno value. * negative errno value.
*/ */
int uds_map_to_system_error(int error) int uds_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];
......
...@@ -71,7 +71,7 @@ const char * __must_check uds_string_error(int errnum, char *buf, size_t buflen) ...@@ -71,7 +71,7 @@ const char * __must_check uds_string_error(int errnum, char *buf, size_t buflen)
const char *uds_string_error_name(int errnum, char *buf, size_t buflen); const char *uds_string_error_name(int errnum, char *buf, size_t buflen);
int uds_map_to_system_error(int error); int uds_status_to_errno(int error);
int uds_register_error_block(const char *block_name, int first_error, int uds_register_error_block(const char *block_name, int first_error,
int last_reserved_error, const struct error_info *infos, int last_reserved_error, const struct error_info *infos,
......
...@@ -267,13 +267,13 @@ int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_s ...@@ -267,13 +267,13 @@ int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_s
result = uds_make_configuration(parameters, &index_config); result = uds_make_configuration(parameters, &index_config);
if (result != UDS_SUCCESS) { if (result != UDS_SUCCESS) {
uds_log_error_strerror(result, "cannot compute index size"); uds_log_error_strerror(result, "cannot compute index size");
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
result = compute_sizes(index_config, &sizes); result = compute_sizes(index_config, &sizes);
uds_free_configuration(index_config); uds_free_configuration(index_config);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return uds_map_to_system_error(result); return uds_status_to_errno(result);
*index_size = sizes.total_size; *index_size = sizes.total_size;
return UDS_SUCCESS; return UDS_SUCCESS;
......
...@@ -210,7 +210,7 @@ static void handle_callbacks(struct uds_request *request) ...@@ -210,7 +210,7 @@ static void handle_callbacks(struct uds_request *request)
if (request->status == UDS_SUCCESS) if (request->status == UDS_SUCCESS)
update_session_stats(request); update_session_stats(request);
request->status = uds_map_to_system_error(request->status); request->status = uds_status_to_errno(request->status);
request->callback(request); request->callback(request);
release_index_session(index_session); release_index_session(index_session);
} }
...@@ -276,7 +276,7 @@ int uds_create_index_session(struct uds_index_session **session) ...@@ -276,7 +276,7 @@ int uds_create_index_session(struct uds_index_session **session)
return -EINVAL; return -EINVAL;
} }
return uds_map_to_system_error(make_empty_index_session(session)); return uds_status_to_errno(make_empty_index_session(session));
} }
static int __must_check start_loading_index_session(struct uds_index_session *index_session) static int __must_check start_loading_index_session(struct uds_index_session *index_session)
...@@ -374,7 +374,7 @@ int uds_open_index(enum uds_open_index_type open_type, ...@@ -374,7 +374,7 @@ int uds_open_index(enum uds_open_index_type open_type,
result = start_loading_index_session(session); result = start_loading_index_session(session);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return uds_map_to_system_error(result); return uds_status_to_errno(result);
session->parameters = *parameters; session->parameters = *parameters;
format_dev_t(name, parameters->bdev->bd_dev); format_dev_t(name, parameters->bdev->bd_dev);
...@@ -386,7 +386,7 @@ int uds_open_index(enum uds_open_index_type open_type, ...@@ -386,7 +386,7 @@ int uds_open_index(enum uds_open_index_type open_type,
get_open_type_string(open_type)); get_open_type_string(open_type));
finish_loading_index_session(session, result); finish_loading_index_session(session, result);
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
static void wait_for_no_requests_in_progress(struct uds_index_session *index_session) static void wait_for_no_requests_in_progress(struct uds_index_session *index_session)
...@@ -470,7 +470,7 @@ int uds_suspend_index_session(struct uds_index_session *session, bool save) ...@@ -470,7 +470,7 @@ int uds_suspend_index_session(struct uds_index_session *session, bool save)
uds_unlock_mutex(&session->request_mutex); uds_unlock_mutex(&session->request_mutex);
if (no_work) if (no_work)
return uds_map_to_system_error(result); return uds_status_to_errno(result);
if (rebuilding) if (rebuilding)
suspend_rebuild(session); suspend_rebuild(session);
...@@ -484,7 +484,7 @@ int uds_suspend_index_session(struct uds_index_session *session, bool save) ...@@ -484,7 +484,7 @@ int uds_suspend_index_session(struct uds_index_session *session, bool save)
session->state |= IS_FLAG_SUSPENDED; session->state |= IS_FLAG_SUSPENDED;
uds_broadcast_cond(&session->request_cond); uds_broadcast_cond(&session->request_cond);
uds_unlock_mutex(&session->request_mutex); uds_unlock_mutex(&session->request_mutex);
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
static int replace_device(struct uds_index_session *session, struct block_device *bdev) static int replace_device(struct uds_index_session *session, struct block_device *bdev)
...@@ -536,7 +536,7 @@ int uds_resume_index_session(struct uds_index_session *session, ...@@ -536,7 +536,7 @@ int uds_resume_index_session(struct uds_index_session *session,
session->state &= ~IS_FLAG_WAITING; session->state &= ~IS_FLAG_WAITING;
uds_broadcast_cond(&session->request_cond); uds_broadcast_cond(&session->request_cond);
uds_unlock_mutex(&session->request_mutex); uds_unlock_mutex(&session->request_mutex);
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
} }
...@@ -635,7 +635,7 @@ int uds_close_index(struct uds_index_session *index_session) ...@@ -635,7 +635,7 @@ int uds_close_index(struct uds_index_session *index_session)
} }
uds_unlock_mutex(&index_session->request_mutex); uds_unlock_mutex(&index_session->request_mutex);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return uds_map_to_system_error(result); return uds_status_to_errno(result);
uds_log_debug("Closing index"); uds_log_debug("Closing index");
wait_for_no_requests_in_progress(index_session); wait_for_no_requests_in_progress(index_session);
...@@ -646,7 +646,7 @@ int uds_close_index(struct uds_index_session *index_session) ...@@ -646,7 +646,7 @@ int uds_close_index(struct uds_index_session *index_session)
index_session->state &= ~IS_FLAG_CLOSING; index_session->state &= ~IS_FLAG_CLOSING;
uds_broadcast_cond(&index_session->request_cond); uds_broadcast_cond(&index_session->request_cond);
uds_unlock_mutex(&index_session->request_mutex); uds_unlock_mutex(&index_session->request_mutex);
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
/* This will save and close an open index before destroying the session. */ /* This will save and close an open index before destroying the session. */
...@@ -702,7 +702,7 @@ int uds_destroy_index_session(struct uds_index_session *index_session) ...@@ -702,7 +702,7 @@ int uds_destroy_index_session(struct uds_index_session *index_session)
uds_destroy_mutex(&index_session->request_mutex); uds_destroy_mutex(&index_session->request_mutex);
uds_log_debug("Destroyed index session"); uds_log_debug("Destroyed index session");
uds_free(index_session); uds_free(index_session);
return uds_map_to_system_error(result); return uds_status_to_errno(result);
} }
/* Wait until all callbacks for index operations are complete. */ /* Wait until all callbacks for index operations are complete. */
......
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