summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-01-26 21:42:27 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:17 -0500
commit86492a3f698de5d66777ba18e06e030cb2c5cf9a (patch)
treed4e8fd8ec1f7c42b3a1875be499b2dcac91e66f4 /drivers/md
parentb06d5c37b88b97359e98820eecae99e243512c1b (diff)
downloadlinux-stable-86492a3f698de5d66777ba18e06e030cb2c5cf9a.tar.gz
linux-stable-86492a3f698de5d66777ba18e06e030cb2c5cf9a.tar.bz2
linux-stable-86492a3f698de5d66777ba18e06e030cb2c5cf9a.zip
dm vdo: slight cleanup of UDS error codes
No need to increment each UDS_ error code manually (relative to UDS_ERROR_CODE_BASE). Also, remove unused PRP_BLOCK_START and PRP_BLOCK_END. Lastly, UDS_SUCCESS and VDO_SUCCESS are used interchangeably; so best to explicitly set VDO_SUCCESS equal to UDS_SUCCESS. 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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/errors.h35
-rw-r--r--drivers/md/dm-vdo/status-codes.h4
2 files changed, 18 insertions, 21 deletions
diff --git a/drivers/md/dm-vdo/errors.h b/drivers/md/dm-vdo/errors.h
index 0129fa37d8d8..c37f198a159c 100644
--- a/drivers/md/dm-vdo/errors.h
+++ b/drivers/md/dm-vdo/errors.h
@@ -15,43 +15,42 @@
enum uds_status_codes {
/* Successful return */
UDS_SUCCESS = 0,
-
/* Used as a base value for reporting internal errors */
UDS_ERROR_CODE_BASE = 1024,
/* Index overflow */
- UDS_OVERFLOW = UDS_ERROR_CODE_BASE + 0,
+ UDS_OVERFLOW = UDS_ERROR_CODE_BASE,
/* Invalid argument passed to internal routine */
- UDS_INVALID_ARGUMENT = UDS_ERROR_CODE_BASE + 1,
+ UDS_INVALID_ARGUMENT,
/* UDS data structures are in an invalid state */
- UDS_BAD_STATE = UDS_ERROR_CODE_BASE + 2,
+ UDS_BAD_STATE,
/* Attempt to enter the same name into an internal structure twice */
- UDS_DUPLICATE_NAME = UDS_ERROR_CODE_BASE + 3,
+ UDS_DUPLICATE_NAME,
/* An assertion failed */
- UDS_ASSERTION_FAILED = UDS_ERROR_CODE_BASE + 4,
+ UDS_ASSERTION_FAILED,
/* A request has been queued for later processing (not an error) */
- UDS_QUEUED = UDS_ERROR_CODE_BASE + 5,
+ UDS_QUEUED,
/* A problem has occurred with a buffer */
- UDS_BUFFER_ERROR = UDS_ERROR_CODE_BASE + 6,
+ UDS_BUFFER_ERROR,
/* No directory was found where one was expected */
- UDS_NO_DIRECTORY = UDS_ERROR_CODE_BASE + 7,
+ UDS_NO_DIRECTORY,
/* This error range has already been registered */
- UDS_ALREADY_REGISTERED = UDS_ERROR_CODE_BASE + 8,
+ UDS_ALREADY_REGISTERED,
/* Attempt to read or write data outside the valid range */
- UDS_OUT_OF_RANGE = UDS_ERROR_CODE_BASE + 9,
+ UDS_OUT_OF_RANGE,
/* Could not load modules */
- UDS_EMODULE_LOAD = UDS_ERROR_CODE_BASE + 10,
+ UDS_EMODULE_LOAD,
/* The index session is disabled */
- UDS_DISABLED = UDS_ERROR_CODE_BASE + 11,
+ UDS_DISABLED,
/* Unknown error */
- UDS_UNKNOWN_ERROR = UDS_ERROR_CODE_BASE + 12,
+ UDS_UNKNOWN_ERROR,
/* The index configuration or volume format is no longer supported */
- UDS_UNSUPPORTED_VERSION = UDS_ERROR_CODE_BASE + 13,
+ UDS_UNSUPPORTED_VERSION,
/* Some index structure is corrupt */
- UDS_CORRUPT_DATA = UDS_ERROR_CODE_BASE + 14,
+ UDS_CORRUPT_DATA,
/* No index state found */
- UDS_NO_INDEX = UDS_ERROR_CODE_BASE + 15,
+ UDS_NO_INDEX,
/* Attempt to access incomplete index save data */
- UDS_INDEX_NOT_SAVED_CLEANLY = UDS_ERROR_CODE_BASE + 16,
+ UDS_INDEX_NOT_SAVED_CLEANLY,
/* One more than the last UDS_INTERNAL error code */
UDS_ERROR_CODE_LAST,
/* One more than the last error this block will ever use */
diff --git a/drivers/md/dm-vdo/status-codes.h b/drivers/md/dm-vdo/status-codes.h
index c5da37ec8b55..9e0126a83c6b 100644
--- a/drivers/md/dm-vdo/status-codes.h
+++ b/drivers/md/dm-vdo/status-codes.h
@@ -12,14 +12,12 @@ 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,
- PRP_BLOCK_START = VDO_BLOCK_END,
- PRP_BLOCK_END = PRP_BLOCK_START + UDS_BLOCK_SIZE,
};
/* VDO-specific status codes. */
enum vdo_status_codes {
/* successful result */
- VDO_SUCCESS,
+ VDO_SUCCESS = UDS_SUCCESS,
/* base of all VDO errors */
VDO_STATUS_CODE_BASE = VDO_BLOCK_START,
/* we haven't written this yet */