1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright 2023 Red Hat
6 #ifndef VDO_STATUS_CODES_H
7 #define VDO_STATUS_CODES_H
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
,
17 /* VDO-specific status codes. */
18 enum vdo_status_codes
{
19 /* base of all VDO errors */
20 VDO_STATUS_CODE_BASE
= VDO_ERRORS_BLOCK_START
,
21 /* we haven't written this yet */
22 VDO_NOT_IMPLEMENTED
= VDO_STATUS_CODE_BASE
,
23 /* input out of range */
25 /* an invalid reference count would result */
26 VDO_REF_COUNT_INVALID
,
27 /* a free block could not be allocated */
29 /* improper or missing configuration option */
30 VDO_BAD_CONFIGURATION
,
31 /* prior operation still in progress */
33 /* page contents incorrect or corrupt data */
35 /* unsupported version of some component */
36 VDO_UNSUPPORTED_VERSION
,
37 /* component id mismatch in decoder */
38 VDO_INCORRECT_COMPONENT
,
39 /* parameters have conflicting values */
40 VDO_PARAMETER_MISMATCH
,
41 /* no partition exists with a given id */
42 VDO_UNKNOWN_PARTITION
,
43 /* a partition already exists with a given id */
45 /* physical block growth of too few blocks */
46 VDO_INCREMENT_TOO_SMALL
,
47 /* incorrect checksum */
48 VDO_CHECKSUM_MISMATCH
,
49 /* a lock is held incorrectly */
51 /* the VDO is in read-only mode */
53 /* the VDO is shutting down */
55 /* the recovery journal has corrupt entries or corrupt metadata */
57 /* exceeds maximum number of slabs supported */
59 /* a compressed block fragment is invalid */
61 /* action is unsupported while rebuilding */
62 VDO_RETRY_AFTER_REBUILD
,
63 /* a block map entry is invalid */
65 /* bio_add_page failed */
66 VDO_BIO_CREATION_FAILED
,
67 /* bad magic number */
71 /* sequence number overflow */
73 /* the VDO is not in a state to perform an admin operation */
74 VDO_INVALID_ADMIN_STATE
,
75 /* one more than last error code */
77 VDO_STATUS_CODE_BLOCK_END
= VDO_ERRORS_BLOCK_END
80 extern const struct error_info vdo_status_list
[];
82 int vdo_register_status_codes(void);
84 int vdo_status_to_errno(int error
);
86 #endif /* VDO_STATUS_CODES_H */