33 #include "erasurecode.h"
34 #include "erasurecode_backend.h"
36 #define FLAT_XOR_LIB_MAJOR 1
37 #define FLAT_XOR_LIB_MINOR 0
38 #define FLAT_XOR_LIB_REV 0
39 #define FLAT_XOR_LIB_VER_STR "1.0"
40 #define FLAT_XOR_LIB_NAME "flat_xor_hd"
41 #if defined(__MACOS__) || defined(__MACOSX__) || defined(__OSX__) || defined(__APPLE__)
42 #define FLAT_XOR_SO_NAME "libXorcode.dylib"
44 #define FLAT_XOR_SO_NAME "libXorcode.so.1"
53 typedef xor_code_t* (*init_xor_hd_code_func)(int, int, int);
67 char **data,
char **parity,
int blocksize)
78 char **data,
char **parity,
int *missing_idxs,
89 char **data,
char **parity,
int *missing_idxs,
90 int destination_idx,
int blocksize)
97 missing_idxs, destination_idx, blocksize);
102 int *missing_idxs,
int *fragments_to_exclude,
103 int *fragments_needed)
109 xor_desc->fragments_needed(
xor_desc, missing_idxs, fragments_to_exclude, fragments_needed);
125 int k = args->uargs.k;
126 int m = args->uargs.m;
127 int hd = args->uargs.hd;
151 return (
void *) bdesc;
181 .GETMETADATASIZE = get_backend_metadata_size_zero,
182 .GETENCODEOFFSET = get_encode_offset_zero,
186 .id = EC_BACKEND_FLAT_XOR_HD,
static int flat_xor_hd_exit(void *desc)
struct ec_backend flat_xor_hd
static void * flat_xor_hd_init(struct ec_backend_args *args, void *sohandle)
struct ec_backend_common backend_flat_xor_hd
static int flat_xor_hd_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
int(* xor_hd_fragments_needed_func)(xor_code_t *, int *, int *, int *)
static bool flat_xor_is_compatible_with(uint32_t version)
struct ec_backend_op_stubs flat_xor_hd_ops
static int flar_xor_hd_element_size(void *desc)
Return the element-size, which is the number of bits stored on a given device, per codeword.
static int flat_xor_hd_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
#define FLAT_XOR_LIB_MINOR
int(* xor_code_decode_func)(xor_code_t *, char **, char **, int *, int, int)
void(* xor_code_encode_func)(xor_code_t *, char **, char **, int)
struct ec_backend_op_stubs flat_xor_hd_op_stubs
static int flat_xor_hd_min_fragments(void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
static int flat_xor_hd_encode(void *desc, char **data, char **parity, int blocksize)
xor_code_t *(* init_xor_hd_code_func)(int, int, int)
#define FLAT_XOR_LIB_NAME
#define FLAT_XOR_LIB_MAJOR
#define FLAT_XOR_LIB_VER_STR
xor_code_encode_func xor_code_encode
xor_code_decode_func xor_code_decode
xor_hd_fragments_needed_func xor_hd_fragments_needed
init_xor_hd_code_func init_xor_hd_code
void xor_reconstruct_one(xor_code_t *code_desc, char **data, char **parity, int *missing_idxs, int index_to_reconstruct, int blocksize)
xor_code_t * init_xor_hd_code(int k, int m, int hd)