dm vdo errors: remove unused error codes
authorMatthew Sakai <msakai@redhat.com>
Wed, 28 Feb 2024 00:22:59 +0000 (19:22 -0500)
committerMike Snitzer <snitzer@kernel.org>
Mon, 4 Mar 2024 20:07:56 +0000 (15:07 -0500)
Also define VDO_SUCCESS in a more central location, and
rename error block constants for clarity.

Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-vdo/errors.c
drivers/md/dm-vdo/errors.h
drivers/md/dm-vdo/status-codes.c
drivers/md/dm-vdo/status-codes.h

index dc1f0533bd7a92bacfb98a688c448dc33155bfc9..df2498553312068bd56d72a194d41cd2eae86757 100644 (file)
@@ -58,13 +58,9 @@ static const struct error_info error_list[] = {
        { "UDS_DUPLICATE_NAME", "Attempt to enter the same name into a delta index twice" },
        { "UDS_ASSERTION_FAILED", "Assertion failed" },
        { "UDS_QUEUED", "Request queued" },
-       { "UDS_BUFFER_ERROR", "Buffer error" },
-       { "UDS_NO_DIRECTORY", "Expected directory is missing" },
        { "UDS_ALREADY_REGISTERED", "Error range already registered" },
        { "UDS_OUT_OF_RANGE", "Cannot access data outside specified limits" },
-       { "UDS_EMODULE_LOAD", "Could not load modules" },
        { "UDS_DISABLED", "UDS library context is disabled" },
-       { "UDS_UNKNOWN_ERROR", "Unknown error" },
        { "UDS_UNSUPPORTED_VERSION", "Unsupported version" },
        { "UDS_CORRUPT_DATA", "Some index structure is corrupt" },
        { "UDS_NO_INDEX", "No index found" },
index cf15d7243204a0f3ba0f57fb19a07c56d0862c0f..c6c085b26a0ea60ac96af401b8bd50b1cc99c49e 100644 (file)
@@ -9,12 +9,13 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-/* Custom error codes and error-related utilities for UDS */
+/* Custom error codes and error-related utilities */
+#define VDO_SUCCESS 0
 
 /* Valid status codes for internal UDS functions. */
 enum uds_status_codes {
        /* Successful return */
-       UDS_SUCCESS = 0,
+       UDS_SUCCESS = VDO_SUCCESS,
        /* Used as a base value for reporting internal errors */
        UDS_ERROR_CODE_BASE = 1024,
        /* Index overflow */
@@ -29,20 +30,12 @@ enum uds_status_codes {
        UDS_ASSERTION_FAILED,
        /* A request has been queued for later processing (not an error) */
        UDS_QUEUED,
-       /* A problem has occurred with a buffer */
-       UDS_BUFFER_ERROR,
-       /* No directory was found where one was expected */
-       UDS_NO_DIRECTORY,
        /* This error range has already been registered */
        UDS_ALREADY_REGISTERED,
        /* Attempt to read or write data outside the valid range */
        UDS_OUT_OF_RANGE,
-       /* Could not load modules */
-       UDS_EMODULE_LOAD,
        /* The index session is disabled */
        UDS_DISABLED,
-       /* Unknown error */
-       UDS_UNKNOWN_ERROR,
        /* The index configuration or volume format is no longer supported */
        UDS_UNSUPPORTED_VERSION,
        /* Some index structure is corrupt */
index efba1ead0acaef53b3c50a7847961bea1888bdd9..92c42b8bbb8b05f7d4fdc578d5fee9efbc93b776 100644 (file)
@@ -15,22 +15,16 @@ const struct error_info vdo_status_list[] = {
        { "VDO_OUT_OF_RANGE", "Out of range" },
        { "VDO_REF_COUNT_INVALID", "Reference count would become invalid" },
        { "VDO_NO_SPACE", "Out of space" },
-       { "VDO_UNEXPECTED_EOF", "Unexpected EOF on block read" },
        { "VDO_BAD_CONFIGURATION", "Bad configuration option" },
-       { "VDO_SOCKET_ERROR", "Socket error" },
-       { "VDO_BAD_ALIGNMENT", "Mis-aligned block reference" },
        { "VDO_COMPONENT_BUSY", "Prior operation still in progress" },
        { "VDO_BAD_PAGE", "Corrupt or incorrect page" },
        { "VDO_UNSUPPORTED_VERSION", "Unsupported component version" },
        { "VDO_INCORRECT_COMPONENT", "Component id mismatch in decoder" },
        { "VDO_PARAMETER_MISMATCH", "Parameters have conflicting values" },
-       { "VDO_BLOCK_SIZE_TOO_SMALL", "The block size is too small" },
        { "VDO_UNKNOWN_PARTITION", "No partition exists with a given id" },
        { "VDO_PARTITION_EXISTS", "A partition already exists with a given id" },
-       { "VDO_NOT_READ_ONLY", "The device is not in read-only mode" },
        { "VDO_INCREMENT_TOO_SMALL", "Physical block growth of too few blocks" },
        { "VDO_CHECKSUM_MISMATCH", "Incorrect checksum" },
-       { "VDO_RECOVERY_JOURNAL_FULL", "The recovery journal is full" },
        { "VDO_LOCK_ERROR", "A lock is held incorrectly" },
        { "VDO_READ_ONLY", "The device is in read-only mode" },
        { "VDO_SHUTTING_DOWN", "The device is shutting down" },
@@ -38,11 +32,7 @@ const struct error_info vdo_status_list[] = {
        { "VDO_TOO_MANY_SLABS", "Exceeds maximum number of slabs supported" },
        { "VDO_INVALID_FRAGMENT", "Compressed block fragment is invalid" },
        { "VDO_RETRY_AFTER_REBUILD", "Retry operation after rebuilding finishes" },
-       { "VDO_UNKNOWN_COMMAND", "The extended command is not known" },
-       { "VDO_COMMAND_ERROR", "Bad extended command parameters" },
-       { "VDO_CANNOT_DETERMINE_SIZE", "Cannot determine config sizes to fit" },
        { "VDO_BAD_MAPPING", "Invalid page mapping" },
-       { "VDO_READ_CACHE_BUSY", "Read cache has no free slots" },
        { "VDO_BIO_CREATION_FAILED", "Bio creation failed" },
        { "VDO_BAD_MAGIC", "Bad magic number" },
        { "VDO_BAD_NONCE", "Bad nonce" },
index 5d1e8bbe54b466e9224919f13e7d8ac16ce349fd..eb847def8eb4901adb0e8b7bbbe0fe408af0de19 100644 (file)
@@ -9,17 +9,15 @@
 #include "errors.h"
 
 enum {
-       UDS_BLOCK_SIZE = UDS_ERROR_CODE_BLOCK_END - UDS_ERROR_CODE_BASE,
-       VDO_BLOCK_START = UDS_ERROR_CODE_BLOCK_END,
-       VDO_BLOCK_END = VDO_BLOCK_START + UDS_BLOCK_SIZE,
+       UDS_ERRORS_BLOCK_SIZE = UDS_ERROR_CODE_BLOCK_END - UDS_ERROR_CODE_BASE,
+       VDO_ERRORS_BLOCK_START = UDS_ERROR_CODE_BLOCK_END,
+       VDO_ERRORS_BLOCK_END = VDO_ERRORS_BLOCK_START + UDS_ERRORS_BLOCK_SIZE,
 };
 
 /* VDO-specific status codes. */
 enum vdo_status_codes {
-       /* successful result */
-       VDO_SUCCESS = UDS_SUCCESS,
        /* base of all VDO errors */
-       VDO_STATUS_CODE_BASE = VDO_BLOCK_START,
+       VDO_STATUS_CODE_BASE = VDO_ERRORS_BLOCK_START,
        /* we haven't written this yet */
        VDO_NOT_IMPLEMENTED = VDO_STATUS_CODE_BASE,
        /* input out of range */
@@ -28,14 +26,8 @@ enum vdo_status_codes {
        VDO_REF_COUNT_INVALID,
        /* a free block could not be allocated */
        VDO_NO_SPACE,
-       /* unexpected EOF on block read */
-       VDO_UNEXPECTED_EOF,
        /* improper or missing configuration option */
        VDO_BAD_CONFIGURATION,
-       /* socket opening or binding problem */
-       VDO_SOCKET_ERROR,
-       /* read or write on non-aligned offset */
-       VDO_BAD_ALIGNMENT,
        /* prior operation still in progress */
        VDO_COMPONENT_BUSY,
        /* page contents incorrect or corrupt data */
@@ -46,20 +38,14 @@ enum vdo_status_codes {
        VDO_INCORRECT_COMPONENT,
        /* parameters have conflicting values */
        VDO_PARAMETER_MISMATCH,
-       /* the block size is too small */
-       VDO_BLOCK_SIZE_TOO_SMALL,
        /* no partition exists with a given id */
        VDO_UNKNOWN_PARTITION,
        /* a partition already exists with a given id */
        VDO_PARTITION_EXISTS,
-       /* the VDO is not in read-only mode */
-       VDO_NOT_READ_ONLY,
        /* physical block growth of too few blocks */
        VDO_INCREMENT_TOO_SMALL,
        /* incorrect checksum */
        VDO_CHECKSUM_MISMATCH,
-       /* the recovery journal is full */
-       VDO_RECOVERY_JOURNAL_FULL,
        /* a lock is held incorrectly */
        VDO_LOCK_ERROR,
        /* the VDO is in read-only mode */
@@ -74,16 +60,8 @@ enum vdo_status_codes {
        VDO_INVALID_FRAGMENT,
        /* action is unsupported while rebuilding */
        VDO_RETRY_AFTER_REBUILD,
-       /* the extended command is not known */
-       VDO_UNKNOWN_COMMAND,
-       /* bad extended command parameters */
-       VDO_COMMAND_ERROR,
-       /* cannot determine sizes to fit */
-       VDO_CANNOT_DETERMINE_SIZE,
        /* a block map entry is invalid */
        VDO_BAD_MAPPING,
-       /* read cache has no free slots */
-       VDO_READ_CACHE_BUSY,
        /* bio_add_page failed */
        VDO_BIO_CREATION_FAILED,
        /* bad magic number */
@@ -98,7 +76,7 @@ enum vdo_status_codes {
        VDO_CANT_ADD_SYSFS_NODE,
        /* one more than last error code */
        VDO_STATUS_CODE_LAST,
-       VDO_STATUS_CODE_BLOCK_END = VDO_BLOCK_END
+       VDO_STATUS_CODE_BLOCK_END = VDO_ERRORS_BLOCK_END
 };
 
 extern const struct error_info vdo_status_list[];