linux/drivers/md/dm-vdo/errors.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2023 Red Hat
 */

#include "errors.h"

#include <linux/compiler.h>
#include <linux/errno.h>

#include "logger.h"
#include "permassert.h"
#include "string-utils.h"

static const struct error_info successful =;

static const char *const message_table[] =;

static const struct error_info error_list[] =;

struct error_block {};

#define MAX_ERROR_BLOCKS

static struct {} registered_errors =;

/* Get the error info for an error number. Also returns the name of the error block, if known. */
static const char *get_error_info(int errnum, const struct error_info **info_ptr)
{}

/* Return a string describing a system error message. */
static const char *system_string_error(int errnum, char *buf, size_t buflen)
{}

/* Convert an error code to a descriptive string. */
const char *uds_string_error(int errnum, char *buf, size_t buflen)
{}

/* Convert an error code to its name. */
const char *uds_string_error_name(int errnum, char *buf, size_t buflen)
{}

/*
 * Translate an error code into a value acceptable to the kernel. The input error code may be a
 * system-generated value (such as -EIO), or an internal UDS status code. The result will be a
 * negative errno value.
 */
int uds_status_to_errno(int error)
{}

/*
 * Register a block of error codes.
 *
 * @block_name: the name of the block of error codes
 * @first_error: the first error code in the block
 * @next_free_error: one past the highest possible error in the block
 * @infos: a pointer to the error info array for the block
 * @info_size: the size of the error info array
 */
int uds_register_error_block(const char *block_name, int first_error,
			     int next_free_error, const struct error_info *infos,
			     size_t info_size)
{}