dm vdo: rename vdo_map_to_system_error to vdo_status_to_errno
authorMike Snitzer <snitzer@kernel.org>
Sat, 27 Jan 2024 02:42:29 +0000 (21:42 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:17 +0000 (13:43 -0500)
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>
drivers/md/dm-vdo/data-vio.c
drivers/md/dm-vdo/dm-vdo-target.c
drivers/md/dm-vdo/status-codes.c
drivers/md/dm-vdo/status-codes.h

index 711396e7a77d8faff8ff82fc12f8a8c933255cfc..7d8100f29e1348bd4e7aa069cad7aab39e708b35 100644 (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;
index fcba50d8d0881b5b204201296acafc69cf0dc58e..e2e60a29e873eceb6a4ec1b5b1b7ec1302d834d5 100644 (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)
index 33b1de29b2059528fea5cd83997e22dac3d9d73a..b4d7eb7f94ff067f85e3ad56287ca602051c47fa 100644 (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];
index 9e0126a83c6ba1efcada14ca6c4864ad1902f003..5d1e8bbe54b466e9224919f13e7d8ac16ce349fd 100644 (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 */