Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <msakai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>

authored by

Matthew Sakai and committed by
Mike Snitzer
ee8f6ec1 8f89115e

+8 -51
-4
drivers/md/dm-vdo/errors.c
··· 58 58 { "UDS_DUPLICATE_NAME", "Attempt to enter the same name into a delta index twice" }, 59 59 { "UDS_ASSERTION_FAILED", "Assertion failed" }, 60 60 { "UDS_QUEUED", "Request queued" }, 61 - { "UDS_BUFFER_ERROR", "Buffer error" }, 62 - { "UDS_NO_DIRECTORY", "Expected directory is missing" }, 63 61 { "UDS_ALREADY_REGISTERED", "Error range already registered" }, 64 62 { "UDS_OUT_OF_RANGE", "Cannot access data outside specified limits" }, 65 - { "UDS_EMODULE_LOAD", "Could not load modules" }, 66 63 { "UDS_DISABLED", "UDS library context is disabled" }, 67 - { "UDS_UNKNOWN_ERROR", "Unknown error" }, 68 64 { "UDS_UNSUPPORTED_VERSION", "Unsupported version" }, 69 65 { "UDS_CORRUPT_DATA", "Some index structure is corrupt" }, 70 66 { "UDS_NO_INDEX", "No index found" },
+3 -10
drivers/md/dm-vdo/errors.h
··· 9 9 #include <linux/compiler.h> 10 10 #include <linux/types.h> 11 11 12 - /* Custom error codes and error-related utilities for UDS */ 12 + /* Custom error codes and error-related utilities */ 13 + #define VDO_SUCCESS 0 13 14 14 15 /* Valid status codes for internal UDS functions. */ 15 16 enum uds_status_codes { 16 17 /* Successful return */ 17 - UDS_SUCCESS = 0, 18 + UDS_SUCCESS = VDO_SUCCESS, 18 19 /* Used as a base value for reporting internal errors */ 19 20 UDS_ERROR_CODE_BASE = 1024, 20 21 /* Index overflow */ ··· 30 29 UDS_ASSERTION_FAILED, 31 30 /* A request has been queued for later processing (not an error) */ 32 31 UDS_QUEUED, 33 - /* A problem has occurred with a buffer */ 34 - UDS_BUFFER_ERROR, 35 - /* No directory was found where one was expected */ 36 - UDS_NO_DIRECTORY, 37 32 /* This error range has already been registered */ 38 33 UDS_ALREADY_REGISTERED, 39 34 /* Attempt to read or write data outside the valid range */ 40 35 UDS_OUT_OF_RANGE, 41 - /* Could not load modules */ 42 - UDS_EMODULE_LOAD, 43 36 /* The index session is disabled */ 44 37 UDS_DISABLED, 45 - /* Unknown error */ 46 - UDS_UNKNOWN_ERROR, 47 38 /* The index configuration or volume format is no longer supported */ 48 39 UDS_UNSUPPORTED_VERSION, 49 40 /* Some index structure is corrupt */
-10
drivers/md/dm-vdo/status-codes.c
··· 15 15 { "VDO_OUT_OF_RANGE", "Out of range" }, 16 16 { "VDO_REF_COUNT_INVALID", "Reference count would become invalid" }, 17 17 { "VDO_NO_SPACE", "Out of space" }, 18 - { "VDO_UNEXPECTED_EOF", "Unexpected EOF on block read" }, 19 18 { "VDO_BAD_CONFIGURATION", "Bad configuration option" }, 20 - { "VDO_SOCKET_ERROR", "Socket error" }, 21 - { "VDO_BAD_ALIGNMENT", "Mis-aligned block reference" }, 22 19 { "VDO_COMPONENT_BUSY", "Prior operation still in progress" }, 23 20 { "VDO_BAD_PAGE", "Corrupt or incorrect page" }, 24 21 { "VDO_UNSUPPORTED_VERSION", "Unsupported component version" }, 25 22 { "VDO_INCORRECT_COMPONENT", "Component id mismatch in decoder" }, 26 23 { "VDO_PARAMETER_MISMATCH", "Parameters have conflicting values" }, 27 - { "VDO_BLOCK_SIZE_TOO_SMALL", "The block size is too small" }, 28 24 { "VDO_UNKNOWN_PARTITION", "No partition exists with a given id" }, 29 25 { "VDO_PARTITION_EXISTS", "A partition already exists with a given id" }, 30 - { "VDO_NOT_READ_ONLY", "The device is not in read-only mode" }, 31 26 { "VDO_INCREMENT_TOO_SMALL", "Physical block growth of too few blocks" }, 32 27 { "VDO_CHECKSUM_MISMATCH", "Incorrect checksum" }, 33 - { "VDO_RECOVERY_JOURNAL_FULL", "The recovery journal is full" }, 34 28 { "VDO_LOCK_ERROR", "A lock is held incorrectly" }, 35 29 { "VDO_READ_ONLY", "The device is in read-only mode" }, 36 30 { "VDO_SHUTTING_DOWN", "The device is shutting down" }, ··· 32 38 { "VDO_TOO_MANY_SLABS", "Exceeds maximum number of slabs supported" }, 33 39 { "VDO_INVALID_FRAGMENT", "Compressed block fragment is invalid" }, 34 40 { "VDO_RETRY_AFTER_REBUILD", "Retry operation after rebuilding finishes" }, 35 - { "VDO_UNKNOWN_COMMAND", "The extended command is not known" }, 36 - { "VDO_COMMAND_ERROR", "Bad extended command parameters" }, 37 - { "VDO_CANNOT_DETERMINE_SIZE", "Cannot determine config sizes to fit" }, 38 41 { "VDO_BAD_MAPPING", "Invalid page mapping" }, 39 - { "VDO_READ_CACHE_BUSY", "Read cache has no free slots" }, 40 42 { "VDO_BIO_CREATION_FAILED", "Bio creation failed" }, 41 43 { "VDO_BAD_MAGIC", "Bad magic number" }, 42 44 { "VDO_BAD_NONCE", "Bad nonce" },
+5 -27
drivers/md/dm-vdo/status-codes.h
··· 9 9 #include "errors.h" 10 10 11 11 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, 15 15 }; 16 16 17 17 /* VDO-specific status codes. */ 18 18 enum vdo_status_codes { 19 - /* successful result */ 20 - VDO_SUCCESS = UDS_SUCCESS, 21 19 /* base of all VDO errors */ 22 - VDO_STATUS_CODE_BASE = VDO_BLOCK_START, 20 + VDO_STATUS_CODE_BASE = VDO_ERRORS_BLOCK_START, 23 21 /* we haven't written this yet */ 24 22 VDO_NOT_IMPLEMENTED = VDO_STATUS_CODE_BASE, 25 23 /* input out of range */ ··· 26 28 VDO_REF_COUNT_INVALID, 27 29 /* a free block could not be allocated */ 28 30 VDO_NO_SPACE, 29 - /* unexpected EOF on block read */ 30 - VDO_UNEXPECTED_EOF, 31 31 /* improper or missing configuration option */ 32 32 VDO_BAD_CONFIGURATION, 33 - /* socket opening or binding problem */ 34 - VDO_SOCKET_ERROR, 35 - /* read or write on non-aligned offset */ 36 - VDO_BAD_ALIGNMENT, 37 33 /* prior operation still in progress */ 38 34 VDO_COMPONENT_BUSY, 39 35 /* page contents incorrect or corrupt data */ ··· 38 46 VDO_INCORRECT_COMPONENT, 39 47 /* parameters have conflicting values */ 40 48 VDO_PARAMETER_MISMATCH, 41 - /* the block size is too small */ 42 - VDO_BLOCK_SIZE_TOO_SMALL, 43 49 /* no partition exists with a given id */ 44 50 VDO_UNKNOWN_PARTITION, 45 51 /* a partition already exists with a given id */ 46 52 VDO_PARTITION_EXISTS, 47 - /* the VDO is not in read-only mode */ 48 - VDO_NOT_READ_ONLY, 49 53 /* physical block growth of too few blocks */ 50 54 VDO_INCREMENT_TOO_SMALL, 51 55 /* incorrect checksum */ 52 56 VDO_CHECKSUM_MISMATCH, 53 - /* the recovery journal is full */ 54 - VDO_RECOVERY_JOURNAL_FULL, 55 57 /* a lock is held incorrectly */ 56 58 VDO_LOCK_ERROR, 57 59 /* the VDO is in read-only mode */ ··· 60 74 VDO_INVALID_FRAGMENT, 61 75 /* action is unsupported while rebuilding */ 62 76 VDO_RETRY_AFTER_REBUILD, 63 - /* the extended command is not known */ 64 - VDO_UNKNOWN_COMMAND, 65 - /* bad extended command parameters */ 66 - VDO_COMMAND_ERROR, 67 - /* cannot determine sizes to fit */ 68 - VDO_CANNOT_DETERMINE_SIZE, 69 77 /* a block map entry is invalid */ 70 78 VDO_BAD_MAPPING, 71 - /* read cache has no free slots */ 72 - VDO_READ_CACHE_BUSY, 73 79 /* bio_add_page failed */ 74 80 VDO_BIO_CREATION_FAILED, 75 81 /* bad magic number */ ··· 76 98 VDO_CANT_ADD_SYSFS_NODE, 77 99 /* one more than last error code */ 78 100 VDO_STATUS_CODE_LAST, 79 - VDO_STATUS_CODE_BLOCK_END = VDO_BLOCK_END 101 + VDO_STATUS_CODE_BLOCK_END = VDO_ERRORS_BLOCK_END 80 102 }; 81 103 82 104 extern const struct error_info vdo_status_list[];