liberasurecode  1.6.1
Erasure Code API library
Data Structures | Macros | Typedefs | Functions | Variables
null.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "erasurecode.h"
#include "erasurecode_backend.h"

Go to the source code of this file.

Data Structures

struct  null_descriptor
 

Macros

#define NULL_LIB_MAJOR   1
 
#define NULL_LIB_MINOR   0
 
#define NULL_LIB_REV   0
 
#define NULL_LIB_VER_STR   "1.0"
 
#define NULL_LIB_NAME   "null"
 
#define NULL_SO_NAME   "libnullcode.so.1"
 
#define DEFAULT_W   32
 

Typedefs

typedef void *(* init_null_code_func) (int, int, int)
 
typedef int(* null_code_encode_func) (void *, char **, char **, int)
 
typedef int(* null_code_decode_func) (void *, char **, char **, int *, int, int)
 
typedef int(* null_reconstruct_func) (char **, int, uint64_t, int, char *)
 
typedef int(* null_code_fragments_needed_func) (void *, int *, int *, int *)
 

Functions

static int null_encode (void *desc, char **data, char **parity, int blocksize)
 
static int null_decode (void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
 
static int null_reconstruct (void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
 
static int null_min_fragments (void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
 
static int null_element_size (void *desc)
 Return the element-size, which is the number of bits stored on a given device, per codeword. More...
 
static void * null_init (struct ec_backend_args *args, void *backend_sohandle)
 
static int null_exit (void *desc)
 
static bool null_is_compatible_with (uint32_t version)
 

Variables

struct ec_backend null
 
struct ec_backend_op_stubs null_ops
 
struct ec_backend_op_stubs null_op_stubs
 
struct ec_backend_common backend_null
 

Macro Definition Documentation

◆ DEFAULT_W

#define DEFAULT_W   32

Definition at line 77 of file null.c.

◆ NULL_LIB_MAJOR

#define NULL_LIB_MAJOR   1

Definition at line 34 of file null.c.

◆ NULL_LIB_MINOR

#define NULL_LIB_MINOR   0

Definition at line 35 of file null.c.

◆ NULL_LIB_NAME

#define NULL_LIB_NAME   "null"

Definition at line 38 of file null.c.

◆ NULL_LIB_REV

#define NULL_LIB_REV   0

Definition at line 36 of file null.c.

◆ NULL_LIB_VER_STR

#define NULL_LIB_VER_STR   "1.0"

Definition at line 37 of file null.c.

◆ NULL_SO_NAME

#define NULL_SO_NAME   "libnullcode.so.1"

Definition at line 42 of file null.c.

Typedef Documentation

◆ init_null_code_func

typedef void*(* init_null_code_func) (int, int, int)

Definition at line 48 of file null.c.

◆ null_code_decode_func

typedef int(* null_code_decode_func) (void *, char **, char **, int *, int, int)

Definition at line 50 of file null.c.

◆ null_code_encode_func

typedef int(* null_code_encode_func) (void *, char **, char **, int)

Definition at line 49 of file null.c.

◆ null_code_fragments_needed_func

typedef int(* null_code_fragments_needed_func) (void *, int *, int *, int *)

Definition at line 52 of file null.c.

◆ null_reconstruct_func

typedef int(* null_reconstruct_func) (char **, int, uint64_t, int, char *)

Definition at line 51 of file null.c.

Function Documentation

◆ null_decode()

static int null_decode ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  blocksize 
)
static

Definition at line 84 of file null.c.

◆ null_element_size()

static int null_element_size ( void *  desc)
static

Return the element-size, which is the number of bits stored on a given device, per codeword.

This is usually just 'w'.

Definition at line 107 of file null.c.

References DEFAULT_W.

◆ null_encode()

static int null_encode ( void *  desc,
char **  data,
char **  parity,
int  blocksize 
)
static

Definition at line 79 of file null.c.

◆ null_exit()

static int null_exit ( void *  desc)
static

Definition at line 206 of file null.c.

◆ null_init()

static void* null_init ( struct ec_backend_args *  args,
void *  backend_sohandle 
)
static

◆ null_is_compatible_with()

static bool null_is_compatible_with ( uint32_t  version)
static

Definition at line 214 of file null.c.

◆ null_min_fragments()

static int null_min_fragments ( void *  desc,
int *  missing_idxs,
int *  fragments_to_exclude,
int *  fragments_needed 
)
static

Definition at line 96 of file null.c.

◆ null_reconstruct()

static int null_reconstruct ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  destination_idx,
int  blocksize 
)
static

Definition at line 90 of file null.c.

Variable Documentation

◆ backend_null

struct ec_backend_common backend_null
Initial value:
= {
.id = EC_BACKEND_NULL,
.name = NULL_LIB_NAME,
.soname = NULL_SO_NAME,
.soversion = NULL_LIB_VER_STR,
.ops = &null_op_stubs,
.ec_backend_version = _VERSION(NULL_LIB_MAJOR, NULL_LIB_MINOR,
}
#define NULL_LIB_MINOR
Definition: null.c:35
#define NULL_LIB_VER_STR
Definition: null.c:37
#define NULL_SO_NAME
Definition: null.c:42
#define NULL_LIB_MAJOR
Definition: null.c:34
struct ec_backend_op_stubs null_op_stubs
Definition: null.c:218
#define NULL_LIB_REV
Definition: null.c:36
#define NULL_LIB_NAME
Definition: null.c:38

Definition at line 214 of file null.c.

◆ null

struct ec_backend null

Definition at line 1 of file null.c.

◆ null_op_stubs

struct ec_backend_op_stubs null_op_stubs
Initial value:
= {
.INIT = null_init,
.EXIT = null_exit,
.ENCODE = null_encode,
.DECODE = null_decode,
.FRAGSNEEDED = null_min_fragments,
.RECONSTRUCT = null_reconstruct,
.ELEMENTSIZE = null_element_size,
.ISCOMPATIBLEWITH = null_is_compatible_with,
.GETMETADATASIZE = get_backend_metadata_size_zero,
.GETENCODEOFFSET = get_encode_offset_zero,
}
static bool null_is_compatible_with(uint32_t version)
Definition: null.c:214
static int null_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
Definition: null.c:90
static void * null_init(struct ec_backend_args *args, void *backend_sohandle)
Definition: null.c:112
static int null_element_size(void *desc)
Return the element-size, which is the number of bits stored on a given device, per codeword.
Definition: null.c:107
static int null_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
Definition: null.c:84
static int null_exit(void *desc)
Definition: null.c:206
static int null_min_fragments(void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
Definition: null.c:96
static int null_encode(void *desc, char **data, char **parity, int blocksize)
Definition: null.c:79

Definition at line 214 of file null.c.

◆ null_ops

struct ec_backend_op_stubs null_ops

Definition at line 1 of file null.c.