Skip to content

Commit ee8f6ec

Browse files
lorelei-sakaiMike Snitzer
authored andcommitted
dm vdo errors: remove unused error codes
Also define VDO_SUCCESS in a more central location, and rename error block constants for clarity. Signed-off-by: Matthew Sakai <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 8f89115 commit ee8f6ec

File tree

4 files changed

+8
-51
lines changed

4 files changed

+8
-51
lines changed

drivers/md/dm-vdo/errors.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ static const struct error_info error_list[] = {
5858
{ "UDS_DUPLICATE_NAME", "Attempt to enter the same name into a delta index twice" },
5959
{ "UDS_ASSERTION_FAILED", "Assertion failed" },
6060
{ "UDS_QUEUED", "Request queued" },
61-
{ "UDS_BUFFER_ERROR", "Buffer error" },
62-
{ "UDS_NO_DIRECTORY", "Expected directory is missing" },
6361
{ "UDS_ALREADY_REGISTERED", "Error range already registered" },
6462
{ "UDS_OUT_OF_RANGE", "Cannot access data outside specified limits" },
65-
{ "UDS_EMODULE_LOAD", "Could not load modules" },
6663
{ "UDS_DISABLED", "UDS library context is disabled" },
67-
{ "UDS_UNKNOWN_ERROR", "Unknown error" },
6864
{ "UDS_UNSUPPORTED_VERSION", "Unsupported version" },
6965
{ "UDS_CORRUPT_DATA", "Some index structure is corrupt" },
7066
{ "UDS_NO_INDEX", "No index found" },

drivers/md/dm-vdo/errors.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
#include <linux/compiler.h>
1010
#include <linux/types.h>
1111

12-
/* Custom error codes and error-related utilities for UDS */
12+
/* Custom error codes and error-related utilities */
13+
#define VDO_SUCCESS 0
1314

1415
/* Valid status codes for internal UDS functions. */
1516
enum uds_status_codes {
1617
/* Successful return */
17-
UDS_SUCCESS = 0,
18+
UDS_SUCCESS = VDO_SUCCESS,
1819
/* Used as a base value for reporting internal errors */
1920
UDS_ERROR_CODE_BASE = 1024,
2021
/* Index overflow */
@@ -29,20 +30,12 @@ enum uds_status_codes {
2930
UDS_ASSERTION_FAILED,
3031
/* A request has been queued for later processing (not an error) */
3132
UDS_QUEUED,
32-
/* A problem has occurred with a buffer */
33-
UDS_BUFFER_ERROR,
34-
/* No directory was found where one was expected */
35-
UDS_NO_DIRECTORY,
3633
/* This error range has already been registered */
3734
UDS_ALREADY_REGISTERED,
3835
/* Attempt to read or write data outside the valid range */
3936
UDS_OUT_OF_RANGE,
40-
/* Could not load modules */
41-
UDS_EMODULE_LOAD,
4237
/* The index session is disabled */
4338
UDS_DISABLED,
44-
/* Unknown error */
45-
UDS_UNKNOWN_ERROR,
4639
/* The index configuration or volume format is no longer supported */
4740
UDS_UNSUPPORTED_VERSION,
4841
/* Some index structure is corrupt */

drivers/md/dm-vdo/status-codes.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,24 @@ const struct error_info vdo_status_list[] = {
1515
{ "VDO_OUT_OF_RANGE", "Out of range" },
1616
{ "VDO_REF_COUNT_INVALID", "Reference count would become invalid" },
1717
{ "VDO_NO_SPACE", "Out of space" },
18-
{ "VDO_UNEXPECTED_EOF", "Unexpected EOF on block read" },
1918
{ "VDO_BAD_CONFIGURATION", "Bad configuration option" },
20-
{ "VDO_SOCKET_ERROR", "Socket error" },
21-
{ "VDO_BAD_ALIGNMENT", "Mis-aligned block reference" },
2219
{ "VDO_COMPONENT_BUSY", "Prior operation still in progress" },
2320
{ "VDO_BAD_PAGE", "Corrupt or incorrect page" },
2421
{ "VDO_UNSUPPORTED_VERSION", "Unsupported component version" },
2522
{ "VDO_INCORRECT_COMPONENT", "Component id mismatch in decoder" },
2623
{ "VDO_PARAMETER_MISMATCH", "Parameters have conflicting values" },
27-
{ "VDO_BLOCK_SIZE_TOO_SMALL", "The block size is too small" },
2824
{ "VDO_UNKNOWN_PARTITION", "No partition exists with a given id" },
2925
{ "VDO_PARTITION_EXISTS", "A partition already exists with a given id" },
30-
{ "VDO_NOT_READ_ONLY", "The device is not in read-only mode" },
3126
{ "VDO_INCREMENT_TOO_SMALL", "Physical block growth of too few blocks" },
3227
{ "VDO_CHECKSUM_MISMATCH", "Incorrect checksum" },
33-
{ "VDO_RECOVERY_JOURNAL_FULL", "The recovery journal is full" },
3428
{ "VDO_LOCK_ERROR", "A lock is held incorrectly" },
3529
{ "VDO_READ_ONLY", "The device is in read-only mode" },
3630
{ "VDO_SHUTTING_DOWN", "The device is shutting down" },
3731
{ "VDO_CORRUPT_JOURNAL", "Recovery journal entries corrupted" },
3832
{ "VDO_TOO_MANY_SLABS", "Exceeds maximum number of slabs supported" },
3933
{ "VDO_INVALID_FRAGMENT", "Compressed block fragment is invalid" },
4034
{ "VDO_RETRY_AFTER_REBUILD", "Retry operation after rebuilding finishes" },
41-
{ "VDO_UNKNOWN_COMMAND", "The extended command is not known" },
42-
{ "VDO_COMMAND_ERROR", "Bad extended command parameters" },
43-
{ "VDO_CANNOT_DETERMINE_SIZE", "Cannot determine config sizes to fit" },
4435
{ "VDO_BAD_MAPPING", "Invalid page mapping" },
45-
{ "VDO_READ_CACHE_BUSY", "Read cache has no free slots" },
4636
{ "VDO_BIO_CREATION_FAILED", "Bio creation failed" },
4737
{ "VDO_BAD_MAGIC", "Bad magic number" },
4838
{ "VDO_BAD_NONCE", "Bad nonce" },

drivers/md/dm-vdo/status-codes.h

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
#include "errors.h"
1010

1111
enum {
12-
UDS_BLOCK_SIZE = UDS_ERROR_CODE_BLOCK_END - UDS_ERROR_CODE_BASE,
13-
VDO_BLOCK_START = UDS_ERROR_CODE_BLOCK_END,
14-
VDO_BLOCK_END = VDO_BLOCK_START + UDS_BLOCK_SIZE,
12+
UDS_ERRORS_BLOCK_SIZE = UDS_ERROR_CODE_BLOCK_END - UDS_ERROR_CODE_BASE,
13+
VDO_ERRORS_BLOCK_START = UDS_ERROR_CODE_BLOCK_END,
14+
VDO_ERRORS_BLOCK_END = VDO_ERRORS_BLOCK_START + UDS_ERRORS_BLOCK_SIZE,
1515
};
1616

1717
/* VDO-specific status codes. */
1818
enum vdo_status_codes {
19-
/* successful result */
20-
VDO_SUCCESS = UDS_SUCCESS,
2119
/* base of all VDO errors */
22-
VDO_STATUS_CODE_BASE = VDO_BLOCK_START,
20+
VDO_STATUS_CODE_BASE = VDO_ERRORS_BLOCK_START,
2321
/* we haven't written this yet */
2422
VDO_NOT_IMPLEMENTED = VDO_STATUS_CODE_BASE,
2523
/* input out of range */
@@ -28,14 +26,8 @@ enum vdo_status_codes {
2826
VDO_REF_COUNT_INVALID,
2927
/* a free block could not be allocated */
3028
VDO_NO_SPACE,
31-
/* unexpected EOF on block read */
32-
VDO_UNEXPECTED_EOF,
3329
/* improper or missing configuration option */
3430
VDO_BAD_CONFIGURATION,
35-
/* socket opening or binding problem */
36-
VDO_SOCKET_ERROR,
37-
/* read or write on non-aligned offset */
38-
VDO_BAD_ALIGNMENT,
3931
/* prior operation still in progress */
4032
VDO_COMPONENT_BUSY,
4133
/* page contents incorrect or corrupt data */
@@ -46,20 +38,14 @@ enum vdo_status_codes {
4638
VDO_INCORRECT_COMPONENT,
4739
/* parameters have conflicting values */
4840
VDO_PARAMETER_MISMATCH,
49-
/* the block size is too small */
50-
VDO_BLOCK_SIZE_TOO_SMALL,
5141
/* no partition exists with a given id */
5242
VDO_UNKNOWN_PARTITION,
5343
/* a partition already exists with a given id */
5444
VDO_PARTITION_EXISTS,
55-
/* the VDO is not in read-only mode */
56-
VDO_NOT_READ_ONLY,
5745
/* physical block growth of too few blocks */
5846
VDO_INCREMENT_TOO_SMALL,
5947
/* incorrect checksum */
6048
VDO_CHECKSUM_MISMATCH,
61-
/* the recovery journal is full */
62-
VDO_RECOVERY_JOURNAL_FULL,
6349
/* a lock is held incorrectly */
6450
VDO_LOCK_ERROR,
6551
/* the VDO is in read-only mode */
@@ -74,16 +60,8 @@ enum vdo_status_codes {
7460
VDO_INVALID_FRAGMENT,
7561
/* action is unsupported while rebuilding */
7662
VDO_RETRY_AFTER_REBUILD,
77-
/* the extended command is not known */
78-
VDO_UNKNOWN_COMMAND,
79-
/* bad extended command parameters */
80-
VDO_COMMAND_ERROR,
81-
/* cannot determine sizes to fit */
82-
VDO_CANNOT_DETERMINE_SIZE,
8363
/* a block map entry is invalid */
8464
VDO_BAD_MAPPING,
85-
/* read cache has no free slots */
86-
VDO_READ_CACHE_BUSY,
8765
/* bio_add_page failed */
8866
VDO_BIO_CREATION_FAILED,
8967
/* bad magic number */
@@ -98,7 +76,7 @@ enum vdo_status_codes {
9876
VDO_CANT_ADD_SYSFS_NODE,
9977
/* one more than last error code */
10078
VDO_STATUS_CODE_LAST,
101-
VDO_STATUS_CODE_BLOCK_END = VDO_BLOCK_END
79+
VDO_STATUS_CODE_BLOCK_END = VDO_ERRORS_BLOCK_END
10280
};
10381

10482
extern const struct error_info vdo_status_list[];

0 commit comments

Comments
 (0)