|
Packit Service |
cbade1 |
/*
|
|
Packit Service |
cbade1 |
* Copyright (c) 2020 Red Hat, Inc.
|
|
Packit Service |
cbade1 |
*
|
|
Packit Service |
cbade1 |
* This program is free software; you can redistribute it and/or
|
|
Packit Service |
cbade1 |
* modify it under the terms of the GNU General Public License
|
|
Packit Service |
cbade1 |
* as published by the Free Software Foundation; either version 2
|
|
Packit Service |
cbade1 |
* of the License, or (at your option) any later version.
|
|
Packit Service |
cbade1 |
*
|
|
Packit Service |
cbade1 |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
cbade1 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
cbade1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
cbade1 |
* GNU General Public License for more details.
|
|
Packit Service |
cbade1 |
*
|
|
Packit Service |
cbade1 |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
cbade1 |
* along with this program; if not, write to the Free Software
|
|
Packit Service |
cbade1 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
cbade1 |
* 02110-1301, USA.
|
|
Packit Service |
cbade1 |
*
|
|
Packit Service |
cbade1 |
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/statusCodes.h#2 $
|
|
Packit Service |
cbade1 |
*/
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
#ifndef STATUS_CODES_H
|
|
Packit Service |
cbade1 |
#define STATUS_CODES_H
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
#include "errors.h"
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
enum {
|
|
Packit Service |
cbade1 |
UDS_BLOCK_SIZE = UDS_ERROR_CODE_BLOCK_END - UDS_ERROR_CODE_BASE,
|
|
Packit Service |
cbade1 |
VDO_BLOCK_START = UDS_ERROR_CODE_BLOCK_END,
|
|
Packit Service |
cbade1 |
VDO_BLOCK_END = VDO_BLOCK_START + UDS_BLOCK_SIZE,
|
|
Packit Service |
cbade1 |
PRP_BLOCK_START = VDO_BLOCK_END,
|
|
Packit Service |
cbade1 |
PRP_BLOCK_END = PRP_BLOCK_START + UDS_BLOCK_SIZE,
|
|
Packit Service |
cbade1 |
};
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
/**
|
|
Packit Service |
cbade1 |
* VDO-specific status codes.
|
|
Packit Service |
cbade1 |
**/
|
|
Packit Service |
cbade1 |
enum vdoStatusCodes {
|
|
Packit Service |
cbade1 |
/** successful result */
|
|
Packit Service |
cbade1 |
VDO_SUCCESS = 0,
|
|
Packit Service |
cbade1 |
/** base of all VDO errors */
|
|
Packit Service |
cbade1 |
VDO_STATUS_CODE_BASE = VDO_BLOCK_START,
|
|
Packit Service |
cbade1 |
/** we haven't written this yet */
|
|
Packit Service |
cbade1 |
VDO_NOT_IMPLEMENTED = VDO_STATUS_CODE_BASE,
|
|
Packit Service |
cbade1 |
/** input out of range */
|
|
Packit Service |
cbade1 |
VDO_OUT_OF_RANGE,
|
|
Packit Service |
cbade1 |
/** an invalid reference count would result */
|
|
Packit Service |
cbade1 |
VDO_REF_COUNT_INVALID,
|
|
Packit Service |
cbade1 |
/** a free block could not be allocated */
|
|
Packit Service |
cbade1 |
VDO_NO_SPACE,
|
|
Packit Service |
cbade1 |
/** unexpected EOF on block read */
|
|
Packit Service |
cbade1 |
VDO_UNEXPECTED_EOF,
|
|
Packit Service |
cbade1 |
/** improper or missing configuration option */
|
|
Packit Service |
cbade1 |
VDO_BAD_CONFIGURATION,
|
|
Packit Service |
cbade1 |
/** socket opening or binding problem */
|
|
Packit Service |
cbade1 |
VDO_SOCKET_ERROR,
|
|
Packit Service |
cbade1 |
/** read or write on non-aligned offset */
|
|
Packit Service |
cbade1 |
VDO_BAD_ALIGNMENT,
|
|
Packit Service |
cbade1 |
/** prior operation still in progress */
|
|
Packit Service |
cbade1 |
VDO_COMPONENT_BUSY,
|
|
Packit Service |
cbade1 |
/** page contents incorrect or corrupt data */
|
|
Packit Service |
cbade1 |
VDO_BAD_PAGE,
|
|
Packit Service |
cbade1 |
/** unsupported version of some component */
|
|
Packit Service |
cbade1 |
VDO_UNSUPPORTED_VERSION,
|
|
Packit Service |
cbade1 |
/** component id mismatch in decoder */
|
|
Packit Service |
cbade1 |
VDO_INCORRECT_COMPONENT,
|
|
Packit Service |
cbade1 |
/** parameters have conflicting values */
|
|
Packit Service |
cbade1 |
VDO_PARAMETER_MISMATCH,
|
|
Packit Service |
cbade1 |
/** the block size is too small */
|
|
Packit Service |
cbade1 |
VDO_BLOCK_SIZE_TOO_SMALL,
|
|
Packit Service |
cbade1 |
/** no partition exists with a given id */
|
|
Packit Service |
cbade1 |
VDO_UNKNOWN_PARTITION,
|
|
Packit Service |
cbade1 |
/** a partition already exists with a given id */
|
|
Packit Service |
cbade1 |
VDO_PARTITION_EXISTS,
|
|
Packit Service |
cbade1 |
/** the VDO is not in read-only mode */
|
|
Packit Service |
cbade1 |
VDO_NOT_READ_ONLY,
|
|
Packit Service |
cbade1 |
/** physical block growth of too few blocks */
|
|
Packit Service |
cbade1 |
VDO_INCREMENT_TOO_SMALL,
|
|
Packit Service |
cbade1 |
/** incorrect checksum */
|
|
Packit Service |
cbade1 |
VDO_CHECKSUM_MISMATCH,
|
|
Packit Service |
cbade1 |
/** the recovery journal is full */
|
|
Packit Service |
cbade1 |
VDO_RECOVERY_JOURNAL_FULL,
|
|
Packit Service |
cbade1 |
/** a lock is held incorrectly */
|
|
Packit Service |
cbade1 |
VDO_LOCK_ERROR,
|
|
Packit Service |
cbade1 |
/** the VDO is in read-only mode */
|
|
Packit Service |
cbade1 |
VDO_READ_ONLY,
|
|
Packit Service |
cbade1 |
/** the VDO is shutting down */
|
|
Packit Service |
cbade1 |
VDO_SHUTTING_DOWN,
|
|
Packit Service |
cbade1 |
/** the recovery journal has corrupt entries */
|
|
Packit Service |
cbade1 |
VDO_CORRUPT_JOURNAL,
|
|
Packit Service |
cbade1 |
/** exceeds maximum number of slabs supported */
|
|
Packit Service |
cbade1 |
VDO_TOO_MANY_SLABS,
|
|
Packit Service |
cbade1 |
/** a compressed block fragment is invalid */
|
|
Packit Service |
cbade1 |
VDO_INVALID_FRAGMENT,
|
|
Packit Service |
cbade1 |
/** action is unsupported while rebuilding */
|
|
Packit Service |
cbade1 |
VDO_RETRY_AFTER_REBUILD,
|
|
Packit Service |
cbade1 |
/** the extended command is not known */
|
|
Packit Service |
cbade1 |
VDO_UNKNOWN_COMMAND,
|
|
Packit Service |
cbade1 |
/** bad extended command parameters */
|
|
Packit Service |
cbade1 |
VDO_COMMAND_ERROR,
|
|
Packit Service |
cbade1 |
/** cannot determine sizes to fit */
|
|
Packit Service |
cbade1 |
VDO_CANNOT_DETERMINE_SIZE,
|
|
Packit Service |
cbade1 |
/** a block map entry is invalid */
|
|
Packit Service |
cbade1 |
VDO_BAD_MAPPING,
|
|
Packit Service |
cbade1 |
/** read cache has no free slots */
|
|
Packit Service |
cbade1 |
VDO_READ_CACHE_BUSY,
|
|
Packit Service |
cbade1 |
/** bio_add_page failed */
|
|
Packit Service |
cbade1 |
VDO_BIO_CREATION_FAILED,
|
|
Packit Service |
cbade1 |
/** bad magic number */
|
|
Packit Service |
cbade1 |
VDO_BAD_MAGIC,
|
|
Packit Service |
cbade1 |
/** bad nonce */
|
|
Packit Service |
cbade1 |
VDO_BAD_NONCE,
|
|
Packit Service |
cbade1 |
/** sequence number overflow */
|
|
Packit Service |
cbade1 |
VDO_JOURNAL_OVERFLOW,
|
|
Packit Service |
cbade1 |
/** the VDO is not in a state to perform an admin operation */
|
|
Packit Service |
cbade1 |
VDO_INVALID_ADMIN_STATE,
|
|
Packit Service |
cbade1 |
/** one more than last error code */
|
|
Packit Service |
cbade1 |
VDO_STATUS_CODE_LAST,
|
|
Packit Service |
cbade1 |
VDO_STATUS_CODE_BLOCK_END = VDO_BLOCK_END
|
|
Packit Service |
cbade1 |
};
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
extern const struct errorInfo vdoStatusList[];
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
/**
|
|
Packit Service |
cbade1 |
* Register the VDO status codes if needed.
|
|
Packit Service |
cbade1 |
*
|
|
Packit Service |
cbade1 |
* @return a success or error code
|
|
Packit Service |
cbade1 |
**/
|
|
Packit Service |
cbade1 |
int registerStatusCodes(void);
|
|
Packit Service |
cbade1 |
|
|
Packit Service |
cbade1 |
#endif // STATUS_CODES_H
|