liberasurecode
1.6.2
Erasure Code API library
|
Go to the documentation of this file.
32 #include "erasurecode.h"
33 #include "erasurecode_backend.h"
34 #define NULL_LIB_MAJOR 1
35 #define NULL_LIB_MINOR 0
36 #define NULL_LIB_REV 0
37 #define NULL_LIB_VER_STR "1.0"
38 #define NULL_LIB_NAME "null"
39 #if defined(__MACOS__) || defined(__MACOSX__) || defined(__OSX__) || defined(__APPLE__)
40 #define NULL_SO_NAME "libnullcode.dylib"
42 #define NULL_SO_NAME "libnullcode.so.1"
48 typedef void* (*init_null_code_func)(int, int, int);
79 static int null_encode(
void *desc,
char **data,
char **parity,
int blocksize)
84 static int null_decode(
void *desc,
char **data,
char **parity,
85 int *missing_idxs,
int blocksize)
91 int *missing_idxs,
int destination_idx,
int blocksize)
97 int *fragments_to_exclude,
int *fragments_needed)
112 static void *
null_init(
struct ec_backend_args *args,
void *backend_sohandle)
123 xdesc->
k = args->uargs.k;
124 xdesc->
m = args->uargs.m;
125 xdesc->
w = args->uargs.w;
131 xdesc->
arg1 = args->uargs.priv_args1.null_args.arg1;
138 long long max_symbols;
139 if (xdesc->
w != 8 && xdesc->
w != 16 && xdesc->
w != 32) {
142 max_symbols = 1LL << xdesc->
w;
143 if ((xdesc->
k + xdesc->
m) > max_symbols) {
160 } func_handle = {.vptr = NULL};
163 func_handle.vptr = NULL;
164 func_handle.vptr = dlsym(backend_sohandle,
"null_code_init");
170 func_handle.vptr = NULL;
171 func_handle.vptr = dlsym(backend_sohandle,
"null_code_encode");
177 func_handle.vptr = NULL;
178 func_handle.vptr = dlsym(backend_sohandle,
"null_code_decode");
184 func_handle.vptr = NULL;
185 func_handle.vptr = dlsym(backend_sohandle,
"null_reconstruct");
191 func_handle.vptr = NULL;
192 func_handle.vptr = dlsym(backend_sohandle,
"null_code_fragments_needed");
198 return (
void *) xdesc;
227 .GETMETADATASIZE = get_backend_metadata_size_zero,
228 .GETENCODEOFFSET = get_encode_offset_zero,
232 .id = EC_BACKEND_NULL,
init_null_code_func init_null_code
static int null_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
struct ec_backend_op_stubs null_ops
static int null_element_size(void *desc)
Return the element-size, which is the number of bits stored on a given device, per codeword.
int(* null_reconstruct_func)(char **, int, uint64_t, int, char *)
struct ec_backend_op_stubs null_op_stubs
void *(* init_null_code_func)(int, int, int)
null_code_encode_func null_code_encode
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 void * null_init(struct ec_backend_args *args, void *backend_sohandle)
struct ec_backend_common backend_null
int(* null_code_encode_func)(void *, char **, char **, int)
null_code_decode_func null_code_decode
int(* null_code_fragments_needed_func)(void *, int *, int *, int *)
null_reconstruct_func null_reconstruct
static int null_min_fragments(void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
null_code_fragments_needed_func null_code_fragments_needed
static bool null_is_compatible_with(uint32_t version)
static int null_exit(void *desc)
int(* null_code_decode_func)(void *, char **, char **, int *, int, int)