32#include "erasurecode.h"
33#include "erasurecode_backend.h"
34#define NULL_LIB_MAJOR 1
35#define NULL_LIB_MINOR 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" LIBERASURECODE_SO_SUFFIX ".dylib"
42#define NULL_SO_NAME "libnullcode" LIBERASURECODE_SO_SUFFIX ".so.1"
46typedef void* (*init_null_code_func)(int, int, int);
77static int null_encode(
void *desc,
char **data,
char **parity,
int blocksize)
83 int *missing_idxs,
int blocksize)
89 int *missing_idxs,
int destination_idx,
int blocksize)
95 int *fragments_to_exclude,
int *fragments_needed)
110static void *
null_init(
struct ec_backend_args *args,
void *backend_sohandle)
121 xdesc->
k = args->uargs.k;
122 xdesc->
m = args->uargs.m;
123 xdesc->
w = args->uargs.w;
129 xdesc->
arg1 = args->uargs.priv_args1.null_args.arg1;
136 long long max_symbols;
137 if (xdesc->
w != 8 && xdesc->
w != 16 && xdesc->
w != 32) {
140 max_symbols = 1LL << xdesc->
w;
141 if ((xdesc->
k + xdesc->
m) > max_symbols) {
158 } func_handle = {.vptr = NULL};
161 func_handle.vptr = NULL;
162 func_handle.vptr = dlsym(backend_sohandle,
"null_code_init");
168 func_handle.vptr = NULL;
169 func_handle.vptr = dlsym(backend_sohandle,
"null_code_encode");
175 func_handle.vptr = NULL;
176 func_handle.vptr = dlsym(backend_sohandle,
"null_code_decode");
182 func_handle.vptr = NULL;
183 func_handle.vptr = dlsym(backend_sohandle,
"null_reconstruct");
189 func_handle.vptr = NULL;
190 func_handle.vptr = dlsym(backend_sohandle,
"null_code_fragments_needed");
196 return (
void *) xdesc;
226 .GETMETADATASIZE = get_backend_metadata_size_zero,
227 .GETENCODEOFFSET = get_encode_offset_zero,
232 .id = EC_BACKEND_NULL,
struct ec_backend_common backend_null
static bool null_is_compatible_with(uint32_t version)
static int null_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
void *(* init_null_code_func)(int, int, int)
static int null_element_size(void *desc)
Return the element-size, which is the number of bits stored on a given device, per codeword.
static struct ec_backend_op_stubs null_op_stubs
int(* null_code_decode_func)(void *, char **, char **, int *, int, int)
static int null_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
__attribute__((visibility("internal")))
int(* null_reconstruct_func)(char **, int, uint64_t, int, char *)
static void * null_init(struct ec_backend_args *args, void *backend_sohandle)
static int null_exit(void *desc)
int(* null_code_encode_func)(void *, char **, char **, int)
static int null_min_fragments(void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
int(* null_code_fragments_needed_func)(void *, int *, int *, int *)
static int null_encode(void *desc, char **data, char **parity, int blocksize)
null_reconstruct_func null_reconstruct
null_code_encode_func null_code_encode
null_code_fragments_needed_func null_code_fragments_needed
init_null_code_func init_null_code
null_code_decode_func null_code_decode