Slim down our exposed symbols
We put way too much stuff out there; we don't need to expose it all. Change-Id: Ic1080a8c9747f044902b0f00d43cc241befa8b27
This commit is contained in:
@@ -134,26 +134,6 @@ typedef struct ec_backend {
|
||||
|
||||
/* ~=*=~==~=*=~==~=*=~==~=*= frontend <-> backend API =*=~==~=*=~==~=*=~==~= */
|
||||
|
||||
/* Register a backend instance with liberasurecode */
|
||||
int liberasurecode_backend_instance_register(ec_backend_t instance);
|
||||
|
||||
/* Unregister a backend instance */
|
||||
int liberasurecode_backend_instance_unregister(ec_backend_t instance);
|
||||
|
||||
|
||||
/* Generic dlopen/dlclose routines */
|
||||
void* liberasurecode_backend_open(ec_backend_t instance);
|
||||
int liberasurecode_backend_close(ec_backend_t instance);
|
||||
|
||||
|
||||
/* Backend query interface */
|
||||
|
||||
/* Name to ID mapping for EC backend */
|
||||
ec_backend_id_t liberasurecode_backend_lookup_id(const char *name);
|
||||
|
||||
/* Get EC backend by name */
|
||||
ec_backend_t liberasurecode_backend_lookup_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* Look up a backend instance by descriptor
|
||||
*
|
||||
|
||||
@@ -24,13 +24,10 @@
|
||||
* vi: set noai tw=79 ts=4 sw=4:
|
||||
*/
|
||||
|
||||
int* create_non_systematic_vand_matrix(int k, int m);
|
||||
void free_systematic_matrix(int *matrix);
|
||||
int* make_systematic_matrix(int k, int m);
|
||||
int is_missing(int *missing_idxs, int index_to_check);
|
||||
int gaussj_inversion(int *matrix, int *inverse, int n);
|
||||
int get_non_zero_diagonal(int *matrix, int row, int num_rows, int num_cols);
|
||||
int rs_galois_div(int x, int y);
|
||||
int rs_galois_inverse(int x);
|
||||
int rs_galois_mult(int x, int y);
|
||||
void init_liberasurecode_rs_vand(int k, int m);
|
||||
|
||||
@@ -40,6 +40,5 @@
|
||||
void rs_galois_init_tables(void);
|
||||
void rs_galois_deinit_tables(void);
|
||||
int rs_galois_mult(int x, int y);
|
||||
int rs_galois_div(int x, int y);
|
||||
int rs_galois_inverse(int x);
|
||||
|
||||
|
||||
@@ -28,111 +28,111 @@
|
||||
|
||||
|
||||
// I made these by hand...
|
||||
unsigned int g_12_6_4_hd_code_parity_bms[] = { 1649, 3235, 2375, 718, 1436, 2872 };
|
||||
unsigned int g_12_6_4_hd_code_data_bms[] = { 7, 14, 28, 56, 49, 35, 13, 26, 52, 41, 19, 38 };
|
||||
static unsigned int g_12_6_4_hd_code_parity_bms[] = { 1649, 3235, 2375, 718, 1436, 2872 };
|
||||
static unsigned int g_12_6_4_hd_code_data_bms[] = { 7, 14, 28, 56, 49, 35, 13, 26, 52, 41, 19, 38 };
|
||||
|
||||
unsigned int g_10_5_3_hd_code_parity_bms[] = { 163, 300, 337, 582, 664 };
|
||||
unsigned int g_10_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17, 6, 24 };
|
||||
static unsigned int g_10_5_3_hd_code_parity_bms[] = { 163, 300, 337, 582, 664 };
|
||||
static unsigned int g_10_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17, 6, 24 };
|
||||
|
||||
unsigned int g_3_3_3_hd_code_parity_bms[] = { 5, 6, 3 };
|
||||
unsigned int g_3_3_3_hd_code_data_bms[] = { 5, 6, 3};
|
||||
static unsigned int g_3_3_3_hd_code_parity_bms[] = { 5, 6, 3 };
|
||||
static unsigned int g_3_3_3_hd_code_data_bms[] = { 5, 6, 3};
|
||||
|
||||
|
||||
// The rest were generated via the "goldilocks" code algorithm
|
||||
unsigned int g_6_6_3_hd_code_parity_bms[] = { 3, 48, 36, 24, 9, 6 };
|
||||
unsigned int g_6_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6 };
|
||||
unsigned int g_7_6_3_hd_code_parity_bms[] = { 67, 112, 36, 24, 9, 6 };
|
||||
unsigned int g_7_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3 };
|
||||
unsigned int g_8_6_3_hd_code_parity_bms[] = { 67, 112, 164, 152, 9, 6 };
|
||||
unsigned int g_8_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12 };
|
||||
unsigned int g_9_6_3_hd_code_parity_bms[] = { 67, 112, 164, 152, 265, 262 };
|
||||
unsigned int g_9_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48 };
|
||||
unsigned int g_10_6_3_hd_code_parity_bms[] = { 579, 112, 676, 152, 265, 262 };
|
||||
unsigned int g_10_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5 };
|
||||
unsigned int g_11_6_3_hd_code_parity_bms[] = { 579, 1136, 676, 152, 1289, 262 };
|
||||
unsigned int g_11_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18 };
|
||||
unsigned int g_12_6_3_hd_code_parity_bms[] = { 579, 1136, 676, 2200, 1289, 2310 };
|
||||
unsigned int g_12_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40 };
|
||||
unsigned int g_13_6_3_hd_code_parity_bms[] = { 4675, 1136, 676, 6296, 1289, 2310 };
|
||||
unsigned int g_13_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9 };
|
||||
unsigned int g_14_6_3_hd_code_parity_bms[] = { 4675, 9328, 676, 6296, 1289, 10502 };
|
||||
unsigned int g_14_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9, 34 };
|
||||
unsigned int g_15_6_3_hd_code_parity_bms[] = { 4675, 9328, 17060, 6296, 17673, 10502 };
|
||||
unsigned int g_15_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9, 34, 20 };
|
||||
static unsigned int g_6_6_3_hd_code_parity_bms[] = { 3, 48, 36, 24, 9, 6 };
|
||||
static unsigned int g_6_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6 };
|
||||
static unsigned int g_7_6_3_hd_code_parity_bms[] = { 67, 112, 36, 24, 9, 6 };
|
||||
static unsigned int g_7_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3 };
|
||||
static unsigned int g_8_6_3_hd_code_parity_bms[] = { 67, 112, 164, 152, 9, 6 };
|
||||
static unsigned int g_8_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12 };
|
||||
static unsigned int g_9_6_3_hd_code_parity_bms[] = { 67, 112, 164, 152, 265, 262 };
|
||||
static unsigned int g_9_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48 };
|
||||
static unsigned int g_10_6_3_hd_code_parity_bms[] = { 579, 112, 676, 152, 265, 262 };
|
||||
static unsigned int g_10_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5 };
|
||||
static unsigned int g_11_6_3_hd_code_parity_bms[] = { 579, 1136, 676, 152, 1289, 262 };
|
||||
static unsigned int g_11_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18 };
|
||||
static unsigned int g_12_6_3_hd_code_parity_bms[] = { 579, 1136, 676, 2200, 1289, 2310 };
|
||||
static unsigned int g_12_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40 };
|
||||
static unsigned int g_13_6_3_hd_code_parity_bms[] = { 4675, 1136, 676, 6296, 1289, 2310 };
|
||||
static unsigned int g_13_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9 };
|
||||
static unsigned int g_14_6_3_hd_code_parity_bms[] = { 4675, 9328, 676, 6296, 1289, 10502 };
|
||||
static unsigned int g_14_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9, 34 };
|
||||
static unsigned int g_15_6_3_hd_code_parity_bms[] = { 4675, 9328, 17060, 6296, 17673, 10502 };
|
||||
static unsigned int g_15_6_3_hd_code_data_bms[] = { 17, 33, 36, 24, 10, 6, 3, 12, 48, 5, 18, 40, 9, 34, 20 };
|
||||
|
||||
unsigned int g_6_6_4_hd_code_parity_bms[] = { 7, 56, 56, 11, 21, 38 };
|
||||
unsigned int g_6_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38 };
|
||||
unsigned int g_7_6_4_hd_code_parity_bms[] = { 71, 120, 120, 11, 21, 38 };
|
||||
unsigned int g_7_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7 };
|
||||
unsigned int g_8_6_4_hd_code_parity_bms[] = { 71, 120, 120, 139, 149, 166 };
|
||||
unsigned int g_8_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56 };
|
||||
unsigned int g_9_6_4_hd_code_parity_bms[] = { 327, 376, 120, 395, 149, 166 };
|
||||
unsigned int g_9_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11 };
|
||||
unsigned int g_10_6_4_hd_code_parity_bms[] = { 327, 376, 632, 395, 661, 678 };
|
||||
unsigned int g_10_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52 };
|
||||
unsigned int g_11_6_4_hd_code_parity_bms[] = { 1351, 1400, 632, 395, 1685, 678 };
|
||||
unsigned int g_11_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19 };
|
||||
unsigned int g_13_6_4_hd_code_parity_bms[] = { 5447, 5496, 2680, 2443, 1685, 6822 };
|
||||
unsigned int g_13_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35 };
|
||||
unsigned int g_14_6_4_hd_code_parity_bms[] = { 5447, 5496, 10872, 10635, 9877, 6822 };
|
||||
unsigned int g_14_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28 };
|
||||
unsigned int g_15_6_4_hd_code_parity_bms[] = { 21831, 5496, 27256, 27019, 9877, 6822 };
|
||||
unsigned int g_15_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13 };
|
||||
unsigned int g_16_6_4_hd_code_parity_bms[] = { 21831, 38264, 27256, 27019, 42645, 39590 };
|
||||
unsigned int g_16_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50 };
|
||||
unsigned int g_17_6_4_hd_code_parity_bms[] = { 87367, 38264, 92792, 27019, 108181, 39590 };
|
||||
unsigned int g_17_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21 };
|
||||
unsigned int g_18_6_4_hd_code_parity_bms[] = { 87367, 169336, 92792, 158091, 108181, 170662 };
|
||||
unsigned int g_18_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42 };
|
||||
unsigned int g_19_6_4_hd_code_parity_bms[] = { 349511, 169336, 354936, 158091, 108181, 432806 };
|
||||
unsigned int g_19_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42, 37 };
|
||||
unsigned int g_20_6_4_hd_code_parity_bms[] = { 349511, 693624, 354936, 682379, 632469, 432806 };
|
||||
unsigned int g_20_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42, 37, 26 };
|
||||
static unsigned int g_6_6_4_hd_code_parity_bms[] = { 7, 56, 56, 11, 21, 38 };
|
||||
static unsigned int g_6_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38 };
|
||||
static unsigned int g_7_6_4_hd_code_parity_bms[] = { 71, 120, 120, 11, 21, 38 };
|
||||
static unsigned int g_7_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7 };
|
||||
static unsigned int g_8_6_4_hd_code_parity_bms[] = { 71, 120, 120, 139, 149, 166 };
|
||||
static unsigned int g_8_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56 };
|
||||
static unsigned int g_9_6_4_hd_code_parity_bms[] = { 327, 376, 120, 395, 149, 166 };
|
||||
static unsigned int g_9_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11 };
|
||||
static unsigned int g_10_6_4_hd_code_parity_bms[] = { 327, 376, 632, 395, 661, 678 };
|
||||
static unsigned int g_10_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52 };
|
||||
static unsigned int g_11_6_4_hd_code_parity_bms[] = { 1351, 1400, 632, 395, 1685, 678 };
|
||||
static unsigned int g_11_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19 };
|
||||
static unsigned int g_13_6_4_hd_code_parity_bms[] = { 5447, 5496, 2680, 2443, 1685, 6822 };
|
||||
static unsigned int g_13_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35 };
|
||||
static unsigned int g_14_6_4_hd_code_parity_bms[] = { 5447, 5496, 10872, 10635, 9877, 6822 };
|
||||
static unsigned int g_14_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28 };
|
||||
static unsigned int g_15_6_4_hd_code_parity_bms[] = { 21831, 5496, 27256, 27019, 9877, 6822 };
|
||||
static unsigned int g_15_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13 };
|
||||
static unsigned int g_16_6_4_hd_code_parity_bms[] = { 21831, 38264, 27256, 27019, 42645, 39590 };
|
||||
static unsigned int g_16_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50 };
|
||||
static unsigned int g_17_6_4_hd_code_parity_bms[] = { 87367, 38264, 92792, 27019, 108181, 39590 };
|
||||
static unsigned int g_17_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21 };
|
||||
static unsigned int g_18_6_4_hd_code_parity_bms[] = { 87367, 169336, 92792, 158091, 108181, 170662 };
|
||||
static unsigned int g_18_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42 };
|
||||
static unsigned int g_19_6_4_hd_code_parity_bms[] = { 349511, 169336, 354936, 158091, 108181, 432806 };
|
||||
static unsigned int g_19_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42, 37 };
|
||||
static unsigned int g_20_6_4_hd_code_parity_bms[] = { 349511, 693624, 354936, 682379, 632469, 432806 };
|
||||
static unsigned int g_20_6_4_hd_code_data_bms[] = { 25, 41, 49, 14, 22, 38, 7, 56, 11, 52, 19, 44, 35, 28, 13, 50, 21, 42, 37, 26 };
|
||||
|
||||
|
||||
unsigned int g_5_5_3_hd_code_parity_bms[] = { 3, 12, 17, 6, 24 };
|
||||
unsigned int g_5_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20 };
|
||||
unsigned int g_6_5_3_hd_code_parity_bms[] = { 35, 44, 17, 6, 24 };
|
||||
unsigned int g_6_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3 };
|
||||
unsigned int g_7_5_3_hd_code_parity_bms[] = { 35, 44, 81, 70, 24 };
|
||||
unsigned int g_7_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12 };
|
||||
unsigned int g_8_5_3_hd_code_parity_bms[] = { 163, 44, 81, 70, 152 };
|
||||
unsigned int g_8_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17 };
|
||||
unsigned int g_9_5_3_hd_code_parity_bms[] = { 163, 300, 337, 70, 152 };
|
||||
unsigned int g_9_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17, 6 };
|
||||
static unsigned int g_5_5_3_hd_code_parity_bms[] = { 3, 12, 17, 6, 24 };
|
||||
static unsigned int g_5_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20 };
|
||||
static unsigned int g_6_5_3_hd_code_parity_bms[] = { 35, 44, 17, 6, 24 };
|
||||
static unsigned int g_6_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3 };
|
||||
static unsigned int g_7_5_3_hd_code_parity_bms[] = { 35, 44, 81, 70, 24 };
|
||||
static unsigned int g_7_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12 };
|
||||
static unsigned int g_8_5_3_hd_code_parity_bms[] = { 163, 44, 81, 70, 152 };
|
||||
static unsigned int g_8_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17 };
|
||||
static unsigned int g_9_5_3_hd_code_parity_bms[] = { 163, 300, 337, 70, 152 };
|
||||
static unsigned int g_9_5_3_hd_code_data_bms[] = { 5, 9, 10, 18, 20, 3, 12, 17, 6 };
|
||||
|
||||
unsigned int g_5_5_4_hd_code_parity_bms[] = { 7, 25, 14, 19, 28 };
|
||||
unsigned int g_5_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26 };
|
||||
unsigned int g_6_5_4_hd_code_parity_bms[] = { 39, 57, 46, 19, 28 };
|
||||
unsigned int g_6_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7 };
|
||||
unsigned int g_7_5_4_hd_code_parity_bms[] = { 103, 57, 46, 83, 92 };
|
||||
unsigned int g_7_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25 };
|
||||
unsigned int g_8_5_4_hd_code_parity_bms[] = { 103, 185, 174, 211, 92 };
|
||||
unsigned int g_8_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14 };
|
||||
unsigned int g_9_5_4_hd_code_parity_bms[] = { 359, 441, 174, 211, 348 };
|
||||
unsigned int g_9_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14, 19 };
|
||||
unsigned int g_10_5_4_hd_code_parity_bms[] = { 359, 441, 686, 723, 860 };
|
||||
unsigned int g_10_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14, 19, 28 };
|
||||
static unsigned int g_5_5_4_hd_code_parity_bms[] = { 7, 25, 14, 19, 28 };
|
||||
static unsigned int g_5_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26 };
|
||||
static unsigned int g_6_5_4_hd_code_parity_bms[] = { 39, 57, 46, 19, 28 };
|
||||
static unsigned int g_6_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7 };
|
||||
static unsigned int g_7_5_4_hd_code_parity_bms[] = { 103, 57, 46, 83, 92 };
|
||||
static unsigned int g_7_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25 };
|
||||
static unsigned int g_8_5_4_hd_code_parity_bms[] = { 103, 185, 174, 211, 92 };
|
||||
static unsigned int g_8_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14 };
|
||||
static unsigned int g_9_5_4_hd_code_parity_bms[] = { 359, 441, 174, 211, 348 };
|
||||
static unsigned int g_9_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14, 19 };
|
||||
static unsigned int g_10_5_4_hd_code_parity_bms[] = { 359, 441, 686, 723, 860 };
|
||||
static unsigned int g_10_5_4_hd_code_data_bms[] = { 11, 13, 21, 22, 26, 7, 25, 14, 19, 28 };
|
||||
|
||||
// Indexed by k
|
||||
unsigned int * hd4_m5_parity[11] = { 0, 0, 0, 0, 0, g_5_5_4_hd_code_parity_bms, g_6_5_4_hd_code_parity_bms, g_7_5_4_hd_code_parity_bms, g_8_5_4_hd_code_parity_bms, g_9_5_4_hd_code_parity_bms, g_10_5_4_hd_code_parity_bms };
|
||||
unsigned int * hd4_m5_data[11] = { 0, 0, 0, 0, 0, g_5_5_4_hd_code_data_bms, g_6_5_4_hd_code_data_bms, g_7_5_4_hd_code_data_bms, g_8_5_4_hd_code_data_bms, g_9_5_4_hd_code_data_bms, g_10_5_4_hd_code_data_bms };
|
||||
unsigned int * hd4_m6_parity[21] = { 0, 0, 0, 0, 0, 0, g_6_6_4_hd_code_parity_bms, g_7_6_4_hd_code_parity_bms, g_8_6_4_hd_code_parity_bms, g_9_6_4_hd_code_parity_bms, g_10_6_4_hd_code_parity_bms, g_11_6_4_hd_code_parity_bms, g_12_6_4_hd_code_parity_bms, g_13_6_4_hd_code_parity_bms, g_14_6_4_hd_code_parity_bms, g_15_6_4_hd_code_parity_bms, g_16_6_4_hd_code_parity_bms, g_17_6_4_hd_code_parity_bms, g_18_6_4_hd_code_parity_bms, g_19_6_4_hd_code_parity_bms, g_20_6_4_hd_code_parity_bms };
|
||||
static unsigned int * hd4_m5_parity[11] = { 0, 0, 0, 0, 0, g_5_5_4_hd_code_parity_bms, g_6_5_4_hd_code_parity_bms, g_7_5_4_hd_code_parity_bms, g_8_5_4_hd_code_parity_bms, g_9_5_4_hd_code_parity_bms, g_10_5_4_hd_code_parity_bms };
|
||||
static unsigned int * hd4_m5_data[11] = { 0, 0, 0, 0, 0, g_5_5_4_hd_code_data_bms, g_6_5_4_hd_code_data_bms, g_7_5_4_hd_code_data_bms, g_8_5_4_hd_code_data_bms, g_9_5_4_hd_code_data_bms, g_10_5_4_hd_code_data_bms };
|
||||
static unsigned int * hd4_m6_parity[21] = { 0, 0, 0, 0, 0, 0, g_6_6_4_hd_code_parity_bms, g_7_6_4_hd_code_parity_bms, g_8_6_4_hd_code_parity_bms, g_9_6_4_hd_code_parity_bms, g_10_6_4_hd_code_parity_bms, g_11_6_4_hd_code_parity_bms, g_12_6_4_hd_code_parity_bms, g_13_6_4_hd_code_parity_bms, g_14_6_4_hd_code_parity_bms, g_15_6_4_hd_code_parity_bms, g_16_6_4_hd_code_parity_bms, g_17_6_4_hd_code_parity_bms, g_18_6_4_hd_code_parity_bms, g_19_6_4_hd_code_parity_bms, g_20_6_4_hd_code_parity_bms };
|
||||
|
||||
unsigned int * hd4_m6_data[21] = { 0, 0, 0, 0, 0, 0, g_6_6_4_hd_code_data_bms, g_7_6_4_hd_code_data_bms, g_8_6_4_hd_code_data_bms, g_9_6_4_hd_code_data_bms, g_10_6_4_hd_code_data_bms, g_11_6_4_hd_code_data_bms, g_12_6_4_hd_code_data_bms, g_13_6_4_hd_code_data_bms, g_14_6_4_hd_code_data_bms, g_15_6_4_hd_code_data_bms, g_16_6_4_hd_code_data_bms, g_17_6_4_hd_code_data_bms, g_18_6_4_hd_code_data_bms, g_19_6_4_hd_code_data_bms, g_20_6_4_hd_code_data_bms };
|
||||
static unsigned int * hd4_m6_data[21] = { 0, 0, 0, 0, 0, 0, g_6_6_4_hd_code_data_bms, g_7_6_4_hd_code_data_bms, g_8_6_4_hd_code_data_bms, g_9_6_4_hd_code_data_bms, g_10_6_4_hd_code_data_bms, g_11_6_4_hd_code_data_bms, g_12_6_4_hd_code_data_bms, g_13_6_4_hd_code_data_bms, g_14_6_4_hd_code_data_bms, g_15_6_4_hd_code_data_bms, g_16_6_4_hd_code_data_bms, g_17_6_4_hd_code_data_bms, g_18_6_4_hd_code_data_bms, g_19_6_4_hd_code_data_bms, g_20_6_4_hd_code_data_bms };
|
||||
|
||||
unsigned int * hd3_m5_parity[11] = { 0, 0, 0, 0, 0, g_5_5_3_hd_code_parity_bms, g_6_5_3_hd_code_parity_bms, g_7_5_3_hd_code_parity_bms, g_8_5_3_hd_code_parity_bms, g_9_5_3_hd_code_parity_bms, g_10_5_3_hd_code_parity_bms };
|
||||
unsigned int * hd3_m5_data[11] = { 0, 0, 0, 0, 0, g_5_5_3_hd_code_data_bms, g_6_5_3_hd_code_data_bms, g_7_5_3_hd_code_data_bms, g_8_5_3_hd_code_data_bms, g_9_5_3_hd_code_data_bms, g_10_5_3_hd_code_data_bms };
|
||||
unsigned int * hd3_m6_parity[16] = { 0, 0, 0, 0, 0, 0, g_6_6_3_hd_code_parity_bms, g_7_6_3_hd_code_parity_bms, g_8_6_3_hd_code_parity_bms, g_9_6_3_hd_code_parity_bms, g_10_6_3_hd_code_parity_bms, g_11_6_3_hd_code_parity_bms, g_12_6_3_hd_code_parity_bms, g_13_6_3_hd_code_parity_bms, g_14_6_3_hd_code_parity_bms, g_15_6_3_hd_code_parity_bms };
|
||||
unsigned int * hd3_m6_data[16] = { 0, 0, 0, 0, 0, 0, g_6_6_3_hd_code_data_bms, g_7_6_3_hd_code_data_bms, g_8_6_3_hd_code_data_bms, g_9_6_3_hd_code_data_bms, g_10_6_3_hd_code_data_bms, g_11_6_3_hd_code_data_bms, g_12_6_3_hd_code_data_bms, g_13_6_3_hd_code_data_bms, g_14_6_3_hd_code_data_bms, g_15_6_3_hd_code_data_bms };
|
||||
static unsigned int * hd3_m5_parity[11] = { 0, 0, 0, 0, 0, g_5_5_3_hd_code_parity_bms, g_6_5_3_hd_code_parity_bms, g_7_5_3_hd_code_parity_bms, g_8_5_3_hd_code_parity_bms, g_9_5_3_hd_code_parity_bms, g_10_5_3_hd_code_parity_bms };
|
||||
static unsigned int * hd3_m5_data[11] = { 0, 0, 0, 0, 0, g_5_5_3_hd_code_data_bms, g_6_5_3_hd_code_data_bms, g_7_5_3_hd_code_data_bms, g_8_5_3_hd_code_data_bms, g_9_5_3_hd_code_data_bms, g_10_5_3_hd_code_data_bms };
|
||||
static unsigned int * hd3_m6_parity[16] = { 0, 0, 0, 0, 0, 0, g_6_6_3_hd_code_parity_bms, g_7_6_3_hd_code_parity_bms, g_8_6_3_hd_code_parity_bms, g_9_6_3_hd_code_parity_bms, g_10_6_3_hd_code_parity_bms, g_11_6_3_hd_code_parity_bms, g_12_6_3_hd_code_parity_bms, g_13_6_3_hd_code_parity_bms, g_14_6_3_hd_code_parity_bms, g_15_6_3_hd_code_parity_bms };
|
||||
static unsigned int * hd3_m6_data[16] = { 0, 0, 0, 0, 0, 0, g_6_6_3_hd_code_data_bms, g_7_6_3_hd_code_data_bms, g_8_6_3_hd_code_data_bms, g_9_6_3_hd_code_data_bms, g_10_6_3_hd_code_data_bms, g_11_6_3_hd_code_data_bms, g_12_6_3_hd_code_data_bms, g_13_6_3_hd_code_data_bms, g_14_6_3_hd_code_data_bms, g_15_6_3_hd_code_data_bms };
|
||||
|
||||
unsigned int * hd3_m3_parity[4] = { 0, 0, 0, g_3_3_3_hd_code_parity_bms };
|
||||
unsigned int * hd3_m3_data[4] = { 0, 0, 0, g_3_3_3_hd_code_data_bms };
|
||||
static unsigned int * hd3_m3_parity[4] = { 0, 0, 0, g_3_3_3_hd_code_parity_bms };
|
||||
static unsigned int * hd3_m3_data[4] = { 0, 0, 0, g_3_3_3_hd_code_data_bms };
|
||||
|
||||
unsigned int ** parity_bm_hd4 [7] = { 0, 0, 0, 0, 0, hd4_m5_parity, hd4_m6_parity };
|
||||
unsigned int ** data_bm_hd4 [7] = { 0, 0, 0, 0, 0, hd4_m5_data, hd4_m6_data };
|
||||
unsigned int ** parity_bm_hd3 [7] = { 0, 0, 0, hd3_m3_parity, 0, hd3_m5_parity, hd3_m6_parity };
|
||||
unsigned int ** data_bm_hd3 [7] = { 0, 0, 0, hd3_m3_data, 0, hd3_m5_data, hd3_m6_data };
|
||||
static unsigned int ** parity_bm_hd4 [7] = { 0, 0, 0, 0, 0, hd4_m5_parity, hd4_m6_parity };
|
||||
static unsigned int ** data_bm_hd4 [7] = { 0, 0, 0, 0, 0, hd4_m5_data, hd4_m6_data };
|
||||
static unsigned int ** parity_bm_hd3 [7] = { 0, 0, 0, hd3_m3_parity, 0, hd3_m5_parity, hd3_m6_parity };
|
||||
static unsigned int ** data_bm_hd3 [7] = { 0, 0, 0, hd3_m3_data, 0, hd3_m5_data, hd3_m6_data };
|
||||
|
||||
#define PARITY_BM_ARY(k, m, hd) (hd == 3) ? parity_bm_hd3[m][k] : parity_bm_hd4[m][k]
|
||||
#define DATA_BM_ARY(k, m, hd) (hd == 3) ? data_bm_hd3[m][k] : data_bm_hd4[m][k]
|
||||
|
||||
@@ -1,94 +1,3 @@
|
||||
D data_bm_hd3
|
||||
D data_bm_hd4
|
||||
D g_10_5_3_hd_code_data_bms
|
||||
D g_10_5_3_hd_code_parity_bms
|
||||
D g_10_5_4_hd_code_data_bms
|
||||
D g_10_5_4_hd_code_parity_bms
|
||||
D g_10_6_3_hd_code_data_bms
|
||||
D g_10_6_3_hd_code_parity_bms
|
||||
D g_10_6_4_hd_code_data_bms
|
||||
D g_10_6_4_hd_code_parity_bms
|
||||
D g_11_6_3_hd_code_data_bms
|
||||
D g_11_6_3_hd_code_parity_bms
|
||||
D g_11_6_4_hd_code_data_bms
|
||||
D g_11_6_4_hd_code_parity_bms
|
||||
D g_12_6_3_hd_code_data_bms
|
||||
D g_12_6_3_hd_code_parity_bms
|
||||
D g_12_6_4_hd_code_data_bms
|
||||
D g_12_6_4_hd_code_parity_bms
|
||||
D g_13_6_3_hd_code_data_bms
|
||||
D g_13_6_3_hd_code_parity_bms
|
||||
D g_13_6_4_hd_code_data_bms
|
||||
D g_13_6_4_hd_code_parity_bms
|
||||
D g_14_6_3_hd_code_data_bms
|
||||
D g_14_6_3_hd_code_parity_bms
|
||||
D g_14_6_4_hd_code_data_bms
|
||||
D g_14_6_4_hd_code_parity_bms
|
||||
D g_15_6_3_hd_code_data_bms
|
||||
D g_15_6_3_hd_code_parity_bms
|
||||
D g_15_6_4_hd_code_data_bms
|
||||
D g_15_6_4_hd_code_parity_bms
|
||||
D g_16_6_4_hd_code_data_bms
|
||||
D g_16_6_4_hd_code_parity_bms
|
||||
D g_17_6_4_hd_code_data_bms
|
||||
D g_17_6_4_hd_code_parity_bms
|
||||
D g_18_6_4_hd_code_data_bms
|
||||
D g_18_6_4_hd_code_parity_bms
|
||||
D g_19_6_4_hd_code_data_bms
|
||||
D g_19_6_4_hd_code_parity_bms
|
||||
D g_20_6_4_hd_code_data_bms
|
||||
D g_20_6_4_hd_code_parity_bms
|
||||
D g_3_3_3_hd_code_data_bms
|
||||
D g_3_3_3_hd_code_parity_bms
|
||||
D g_5_5_3_hd_code_data_bms
|
||||
D g_5_5_3_hd_code_parity_bms
|
||||
D g_5_5_4_hd_code_data_bms
|
||||
D g_5_5_4_hd_code_parity_bms
|
||||
D g_6_5_3_hd_code_data_bms
|
||||
D g_6_5_3_hd_code_parity_bms
|
||||
D g_6_5_4_hd_code_data_bms
|
||||
D g_6_5_4_hd_code_parity_bms
|
||||
D g_6_6_3_hd_code_data_bms
|
||||
D g_6_6_3_hd_code_parity_bms
|
||||
D g_6_6_4_hd_code_data_bms
|
||||
D g_6_6_4_hd_code_parity_bms
|
||||
D g_7_5_3_hd_code_data_bms
|
||||
D g_7_5_3_hd_code_parity_bms
|
||||
D g_7_5_4_hd_code_data_bms
|
||||
D g_7_5_4_hd_code_parity_bms
|
||||
D g_7_6_3_hd_code_data_bms
|
||||
D g_7_6_3_hd_code_parity_bms
|
||||
D g_7_6_4_hd_code_data_bms
|
||||
D g_7_6_4_hd_code_parity_bms
|
||||
D g_8_5_3_hd_code_data_bms
|
||||
D g_8_5_3_hd_code_parity_bms
|
||||
D g_8_5_4_hd_code_data_bms
|
||||
D g_8_5_4_hd_code_parity_bms
|
||||
D g_8_6_3_hd_code_data_bms
|
||||
D g_8_6_3_hd_code_parity_bms
|
||||
D g_8_6_4_hd_code_data_bms
|
||||
D g_8_6_4_hd_code_parity_bms
|
||||
D g_9_5_3_hd_code_data_bms
|
||||
D g_9_5_3_hd_code_parity_bms
|
||||
D g_9_5_4_hd_code_data_bms
|
||||
D g_9_5_4_hd_code_parity_bms
|
||||
D g_9_6_3_hd_code_data_bms
|
||||
D g_9_6_3_hd_code_parity_bms
|
||||
D g_9_6_4_hd_code_data_bms
|
||||
D g_9_6_4_hd_code_parity_bms
|
||||
D hd3_m3_data
|
||||
D hd3_m3_parity
|
||||
D hd3_m5_data
|
||||
D hd3_m5_parity
|
||||
D hd3_m6_data
|
||||
D hd3_m6_parity
|
||||
D hd4_m5_data
|
||||
D hd4_m5_parity
|
||||
D hd4_m6_data
|
||||
D hd4_m6_parity
|
||||
D parity_bm_hd3
|
||||
D parity_bm_hd4
|
||||
R g_bit_lookup
|
||||
T data_bit_lookup
|
||||
T does_parity_have_data
|
||||
T fast_memcpy
|
||||
|
||||
@@ -1,29 +1,3 @@
|
||||
B active_instances
|
||||
B active_instances_rwlock
|
||||
B ec_backends_supported_str
|
||||
B flat_xor_hd
|
||||
B flat_xor_hd_ops
|
||||
B ilog_table
|
||||
B ilog_table_begin
|
||||
B isa_l_rs_cauchy
|
||||
B isa_l_rs_cauchy_ops
|
||||
B isa_l_rs_vand
|
||||
B isa_l_rs_vand_ops
|
||||
B jerasure_rs_cauchy
|
||||
B jerasure_rs_cauchy_ops
|
||||
B jerasure_rs_vand
|
||||
B jerasure_rs_vand_ops
|
||||
B liberasurecode_rs_vand
|
||||
B liberasurecode_rs_vand_ops
|
||||
B libphazr
|
||||
B libphazr_ops
|
||||
B log_table
|
||||
B next_backend_desc
|
||||
B null
|
||||
B null_ops
|
||||
B num_supported_backends
|
||||
B shss
|
||||
B shss_ops
|
||||
D backend_flat_xor_hd
|
||||
D backend_isa_l_rs_cauchy
|
||||
D backend_isa_l_rs_vand
|
||||
@@ -33,18 +7,6 @@ D backend_liberasurecode_rs_vand
|
||||
D backend_libphazr
|
||||
D backend_null
|
||||
D backend_shss
|
||||
D ec_backends_supported
|
||||
D flat_xor_hd_op_stubs
|
||||
D isa_l_rs_cauchy_op_stubs
|
||||
D isa_l_rs_vand_op_stubs
|
||||
D jerasure_rs_cauchy_op_stubs
|
||||
D jerasure_rs_vand_op_stubs
|
||||
D liberasurecode_rs_vand_op_stubs
|
||||
D libphazr_op_stubs
|
||||
D null_op_stubs
|
||||
D shss_op_stubs
|
||||
D valid_gf_w
|
||||
D valid_pairs
|
||||
T add_fragment_metadata
|
||||
T alloc_and_set_buffer
|
||||
T alloc_fragment_buffer
|
||||
@@ -70,15 +32,11 @@ T get_fragment_ptr_array_from_data
|
||||
T get_fragment_ptr_from_data
|
||||
T get_fragment_ptr_from_data_novalidate
|
||||
T get_fragment_size
|
||||
T get_galois_multi_func
|
||||
T get_galois_uninit_func
|
||||
T get_jerasure_sohandle
|
||||
T get_libec_version
|
||||
T get_orig_data_size
|
||||
T init_alg_sig
|
||||
T is_invalid_fragment
|
||||
T is_invalid_fragment_header
|
||||
T is_invalid_fragment_metadata
|
||||
T isa_l_common_init
|
||||
T isa_l_decode
|
||||
T isa_l_element_size
|
||||
@@ -86,13 +44,8 @@ T isa_l_encode
|
||||
T isa_l_exit
|
||||
T isa_l_min_fragments
|
||||
T isa_l_reconstruct
|
||||
T liberasurecode_backend_alloc_desc
|
||||
T liberasurecode_backend_available
|
||||
T liberasurecode_backend_close
|
||||
T liberasurecode_backend_instance_get_by_desc
|
||||
T liberasurecode_backend_instance_register
|
||||
T liberasurecode_backend_instance_unregister
|
||||
T liberasurecode_backend_open
|
||||
T liberasurecode_crc32_alt
|
||||
T liberasurecode_decode
|
||||
T liberasurecode_decode_cleanup
|
||||
@@ -111,14 +64,8 @@ T liberasurecode_instance_destroy
|
||||
T liberasurecode_reconstruct_fragment
|
||||
T liberasurecode_verify_fragment_metadata
|
||||
T liberasurecode_verify_stripe_metadata
|
||||
T load_gf_functions
|
||||
T prepare_fragments_for_decode
|
||||
T prepare_fragments_for_encode
|
||||
T rs_galois_deinit_tables
|
||||
T rs_galois_div
|
||||
T rs_galois_init_tables
|
||||
T rs_galois_inverse
|
||||
T rs_galois_mult
|
||||
T set_backend_id
|
||||
T set_backend_version
|
||||
T set_checksum
|
||||
@@ -127,4 +74,3 @@ T set_fragment_idx
|
||||
T set_fragment_payload_size
|
||||
T set_libec_version
|
||||
T set_orig_data_size
|
||||
T stub_galois_uninit_field
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
B ilog_table
|
||||
B ilog_table_begin
|
||||
B log_table
|
||||
T col_mult
|
||||
T col_mult_and_add
|
||||
T copy_row
|
||||
T create_decoding_matrix
|
||||
T create_non_systematic_vand_matrix
|
||||
T deinit_liberasurecode_rs_vand
|
||||
T free_systematic_matrix
|
||||
T gaussj_inversion
|
||||
T get_first_k_available
|
||||
T get_matrix_row
|
||||
T get_non_zero_diagonal
|
||||
T init_liberasurecode_rs_vand
|
||||
T is_identity_matrix
|
||||
T is_missing
|
||||
@@ -20,15 +10,8 @@ T liberasurecode_rs_vand_encode
|
||||
T liberasurecode_rs_vand_reconstruct
|
||||
T make_systematic_matrix
|
||||
T print_matrix
|
||||
T region_dot_product
|
||||
T region_multiply
|
||||
T region_xor
|
||||
T row_mult
|
||||
T row_mult_and_add
|
||||
T rs_galois_deinit_tables
|
||||
T rs_galois_div
|
||||
T rs_galois_init_tables
|
||||
T rs_galois_inverse
|
||||
T rs_galois_mult
|
||||
T square_matrix_multiply
|
||||
T swap_matrix_rows
|
||||
|
||||
@@ -28,7 +28,6 @@ liberasurecode_la_SOURCES = \
|
||||
backends/isa-l/isa_l_rs_vand.c \
|
||||
backends/isa-l/isa_l_rs_cauchy.c \
|
||||
backends/rs_vand/liberasurecode_rs_vand.c \
|
||||
builtin/rs_vand/rs_galois.c \
|
||||
backends/shss/shss.c \
|
||||
backends/phazrio/libphazr.c
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs isa_l_rs_cauchy_ops;
|
||||
struct ec_backend isa_l_rs_cauchy;
|
||||
struct ec_backend_common backend_isa_l_rs_cauchy;
|
||||
|
||||
static void * isa_l_rs_cauchy_init(struct ec_backend_args *args,
|
||||
@@ -62,7 +60,7 @@ static bool isa_l_rs_cauchy_is_compatible_with(uint32_t version) {
|
||||
return version == backend_isa_l_rs_cauchy.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs isa_l_rs_cauchy_op_stubs = {
|
||||
static struct ec_backend_op_stubs isa_l_rs_cauchy_op_stubs = {
|
||||
.INIT = isa_l_rs_cauchy_init,
|
||||
.EXIT = isa_l_exit,
|
||||
.ENCODE = isa_l_encode,
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs isa_l_rs_vand_ops;
|
||||
struct ec_backend isa_l_rs_vand;
|
||||
struct ec_backend_common backend_isa_l_rs_vand;
|
||||
|
||||
static void * isa_l_rs_vand_init(struct ec_backend_args *args,
|
||||
@@ -61,7 +59,7 @@ static bool isa_l_rs_vand_is_compatible_with(uint32_t version) {
|
||||
return version == backend_isa_l_rs_vand.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs isa_l_rs_vand_op_stubs = {
|
||||
static struct ec_backend_op_stubs isa_l_rs_vand_op_stubs = {
|
||||
.INIT = isa_l_rs_vand_init,
|
||||
.EXIT = isa_l_exit,
|
||||
.ENCODE = isa_l_encode,
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs jerasure_rs_cauchy_ops;
|
||||
struct ec_backend jerasure_rs_cauchy;
|
||||
struct ec_backend_common backend_jerasure_rs_cauchy;
|
||||
|
||||
typedef int* (*cauchy_original_coding_matrix_func)(int, int, int);
|
||||
@@ -451,7 +449,7 @@ static bool jerasure_rs_cauchy_is_compatible_with(uint32_t version) {
|
||||
return version == backend_jerasure_rs_cauchy.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs jerasure_rs_cauchy_op_stubs = {
|
||||
static struct ec_backend_op_stubs jerasure_rs_cauchy_op_stubs = {
|
||||
.INIT = jerasure_rs_cauchy_init,
|
||||
.EXIT = jerasure_rs_cauchy_exit,
|
||||
.ENCODE = jerasure_rs_cauchy_encode,
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs jerasure_rs_vand_ops;
|
||||
struct ec_backend jerasure_rs_vand;
|
||||
struct ec_backend_common backend_jerasure_rs_vand;
|
||||
|
||||
typedef int* (*reed_sol_vandermonde_coding_matrix_func)(int, int, int);
|
||||
@@ -359,7 +357,7 @@ static bool jerasure_rs_vand_is_compatible_with(uint32_t version) {
|
||||
return version == backend_jerasure_rs_vand.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs jerasure_rs_vand_op_stubs = {
|
||||
static struct ec_backend_op_stubs jerasure_rs_vand_op_stubs = {
|
||||
.INIT = jerasure_rs_vand_init,
|
||||
.EXIT = jerasure_rs_vand_exit,
|
||||
.ENCODE = jerasure_rs_vand_encode,
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#define NULL_SO_NAME "libnullcode" LIBERASURECODE_SO_SUFFIX ".so.1"
|
||||
#endif
|
||||
/* Forward declarations */
|
||||
struct ec_backend null;
|
||||
struct ec_backend_op_stubs null_ops;
|
||||
|
||||
typedef void* (*init_null_code_func)(int, int, int);
|
||||
typedef int (*null_code_encode_func)(void *, char **, char **, int);
|
||||
@@ -215,7 +213,7 @@ static bool null_is_compatible_with(uint32_t version) {
|
||||
return true;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs null_op_stubs = {
|
||||
static struct ec_backend_op_stubs null_op_stubs = {
|
||||
.INIT = null_init,
|
||||
.EXIT = null_exit,
|
||||
.ENCODE = null_encode,
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend libphazr;
|
||||
struct ec_backend_op_stubs libphazr_ops;
|
||||
struct ec_backend_common backend_libphazr;
|
||||
|
||||
typedef int (*pio_matrix_encode_func)(char *, char *, char **, int, int, int, int, int, int);
|
||||
@@ -366,7 +364,7 @@ static size_t pio_get_encode_offset(void *desc, int metadata_size)
|
||||
}
|
||||
|
||||
|
||||
struct ec_backend_op_stubs libphazr_op_stubs = {
|
||||
static struct ec_backend_op_stubs libphazr_op_stubs = {
|
||||
.INIT = pio_init,
|
||||
.EXIT = pio_exit,
|
||||
.ENCODE = pio_matrix_encode,
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs liberasurecode_rs_vand_ops;
|
||||
struct ec_backend liberasurecode_rs_vand;
|
||||
struct ec_backend_common backend_liberasurecode_rs_vand;
|
||||
|
||||
typedef int (*liberasurecode_rs_vand_encode_func)(int *, char **, char **, int, int, int);
|
||||
@@ -289,7 +287,7 @@ static bool liberasurecode_rs_vand_is_compatible_with(uint32_t version) {
|
||||
return version == backend_liberasurecode_rs_vand.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs liberasurecode_rs_vand_op_stubs = {
|
||||
static struct ec_backend_op_stubs liberasurecode_rs_vand_op_stubs = {
|
||||
.INIT = liberasurecode_rs_vand_init,
|
||||
.EXIT = liberasurecode_rs_vand_exit,
|
||||
.ENCODE = liberasurecode_rs_vand_encode,
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
#include "erasurecode_backend.h"
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend shss;
|
||||
struct ec_backend_op_stubs shss_ops;
|
||||
struct ec_backend_common backend_shss;
|
||||
|
||||
typedef int (*shss_encode_func)(char **, size_t, int, int, int, int, long long *);
|
||||
@@ -290,7 +288,7 @@ static size_t shss_get_backend_metadata_size(void *desc, int blocksize) {
|
||||
return METADATA;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs shss_op_stubs = {
|
||||
static struct ec_backend_op_stubs shss_op_stubs = {
|
||||
.INIT = shss_init,
|
||||
.EXIT = shss_exit,
|
||||
.ENCODE = shss_encode,
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
#define DEFAULT_W 32
|
||||
|
||||
/* Forward declarations */
|
||||
struct ec_backend_op_stubs flat_xor_hd_ops;
|
||||
struct ec_backend flat_xor_hd;
|
||||
struct ec_backend_common backend_flat_xor_hd;
|
||||
|
||||
typedef xor_code_t* (*init_xor_hd_code_func)(int, int, int);
|
||||
@@ -169,7 +167,7 @@ static bool flat_xor_is_compatible_with(uint32_t version) {
|
||||
return version == backend_flat_xor_hd.ec_backend_version;
|
||||
}
|
||||
|
||||
struct ec_backend_op_stubs flat_xor_hd_op_stubs = {
|
||||
static struct ec_backend_op_stubs flat_xor_hd_op_stubs = {
|
||||
.INIT = flat_xor_hd_init,
|
||||
.EXIT = flat_xor_hd_exit,
|
||||
.ENCODE = flat_xor_hd_encode,
|
||||
|
||||
@@ -91,12 +91,12 @@ int is_identity_matrix(int *matrix, int n)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int* get_matrix_row(int *matrix, int row_idx, int num_cols)
|
||||
static int* get_matrix_row(int *matrix, int row_idx, int num_cols)
|
||||
{
|
||||
return &matrix[row_idx * num_cols];
|
||||
}
|
||||
|
||||
void copy_row(int *from_matrix, int *to_matrix, int from_row_idx, int to_row_idx, int num_cols)
|
||||
static void copy_row(int *from_matrix, int *to_matrix, int from_row_idx, int to_row_idx, int num_cols)
|
||||
{
|
||||
int *from_row = get_matrix_row(from_matrix, from_row_idx, num_cols);
|
||||
int *to_row = get_matrix_row(to_matrix, to_row_idx, num_cols);
|
||||
@@ -142,7 +142,7 @@ void deinit_liberasurecode_rs_vand(void)
|
||||
rs_galois_deinit_tables();
|
||||
}
|
||||
|
||||
int * create_non_systematic_vand_matrix(int k, int m)
|
||||
static int * create_non_systematic_vand_matrix(int k, int m)
|
||||
{
|
||||
int rows = k + m;
|
||||
int cols = k;
|
||||
@@ -169,7 +169,7 @@ int * create_non_systematic_vand_matrix(int k, int m)
|
||||
}
|
||||
|
||||
// Swap the entries of two rows in a matrix
|
||||
void swap_matrix_rows(int *r1, int *r2, int num_cols)
|
||||
static void swap_matrix_rows(int *r1, int *r2, int num_cols)
|
||||
{
|
||||
int i;
|
||||
int tmp;
|
||||
@@ -181,7 +181,7 @@ void swap_matrix_rows(int *r1, int *r2, int num_cols)
|
||||
}
|
||||
}
|
||||
|
||||
void col_mult(int *matrix, int elem, int col_idx, int num_rows, int num_cols)
|
||||
static void col_mult(int *matrix, int elem, int col_idx, int num_rows, int num_cols)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -191,7 +191,7 @@ void col_mult(int *matrix, int elem, int col_idx, int num_rows, int num_cols)
|
||||
}
|
||||
}
|
||||
|
||||
void row_mult(int *matrix, int elem, int row_idx, int num_rows, int num_cols)
|
||||
static void row_mult(int *matrix, int elem, int row_idx, int num_rows, int num_cols)
|
||||
{
|
||||
int i, to_row = row_idx * num_cols;
|
||||
|
||||
@@ -201,7 +201,7 @@ void row_mult(int *matrix, int elem, int row_idx, int num_rows, int num_cols)
|
||||
}
|
||||
}
|
||||
|
||||
void col_mult_and_add(int *matrix, int elem, int from_col, int to_col, int num_rows, int num_cols)
|
||||
static void col_mult_and_add(int *matrix, int elem, int from_col, int to_col, int num_rows, int num_cols)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -212,7 +212,7 @@ void col_mult_and_add(int *matrix, int elem, int from_col, int to_col, int num_r
|
||||
}
|
||||
}
|
||||
|
||||
void row_mult_and_add(int *matrix, int elem, int from_row, int to_row, int num_rows, int num_cols)
|
||||
static void row_mult_and_add(int *matrix, int elem, int from_row, int to_row, int num_rows, int num_cols)
|
||||
{
|
||||
int i;
|
||||
from_row = from_row * num_cols;
|
||||
@@ -224,7 +224,7 @@ void row_mult_and_add(int *matrix, int elem, int from_row, int to_row, int num_r
|
||||
}
|
||||
}
|
||||
|
||||
int get_non_zero_diagonal(int *matrix, int row, int num_rows, int num_cols)
|
||||
static int get_non_zero_diagonal(int *matrix, int row, int num_rows, int num_cols)
|
||||
{
|
||||
int i, row_idx;
|
||||
|
||||
@@ -337,7 +337,7 @@ int gaussj_inversion(int *matrix, int *inverse, int n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void region_xor(char *from_buf, char *to_buf, int blocksize)
|
||||
static void region_xor(char *from_buf, char *to_buf, int blocksize)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -355,7 +355,7 @@ void region_xor(char *from_buf, char *to_buf, int blocksize)
|
||||
}
|
||||
}
|
||||
|
||||
void region_multiply(char *from_buf, char *to_buf, int mult, int xor, int blocksize)
|
||||
static void region_multiply(char *from_buf, char *to_buf, int mult, int xor, int blocksize)
|
||||
{
|
||||
int i;
|
||||
uint16_t *_from_buf = (uint16_t*)from_buf;
|
||||
@@ -384,7 +384,7 @@ void region_multiply(char *from_buf, char *to_buf, int mult, int xor, int blocks
|
||||
}
|
||||
}
|
||||
|
||||
void region_dot_product(char **from_bufs, char *to_buf, int *matrix_row, int num_entries, int blocksize)
|
||||
static void region_dot_product(char **from_bufs, char *to_buf, int *matrix_row, int num_entries, int blocksize)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -411,7 +411,7 @@ int liberasurecode_rs_vand_encode(int *generator_matrix, char **data, char **par
|
||||
return 0;
|
||||
}
|
||||
|
||||
char **get_first_k_available(char **data, char **parity, int *missing, int k)
|
||||
static char **get_first_k_available(char **data, char **parity, int *missing, int k)
|
||||
{
|
||||
int i, j;
|
||||
char **first_k_available = (char**)malloc(sizeof(char*)*k);
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
#define FIELD_SIZE (1 << 16)
|
||||
#define GROUP_SIZE (FIELD_SIZE - 1)
|
||||
|
||||
int *log_table = NULL;
|
||||
int *ilog_table = NULL;
|
||||
int *ilog_table_begin = NULL;
|
||||
static int *log_table = NULL;
|
||||
static int *ilog_table = NULL;
|
||||
static int *ilog_table_begin = NULL;
|
||||
static int init_counter = 0;
|
||||
|
||||
void rs_galois_init_tables(void)
|
||||
@@ -98,7 +98,7 @@ int rs_galois_mult(int x, int y)
|
||||
return ilog_table[sum];
|
||||
}
|
||||
|
||||
int rs_galois_div(int x, int y)
|
||||
static int rs_galois_div(int x, int y)
|
||||
{
|
||||
int diff;
|
||||
if (x == 0) return 0;
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
#include <time.h>
|
||||
#include "xor_code.h"
|
||||
|
||||
const int g_bit_lookup[] = {0x1, 0x2, 0x4, 0x8,
|
||||
0x10, 0x20, 0x40, 0x80,
|
||||
0x100, 0x200, 0x400, 0x800,
|
||||
0x1000, 0x2000, 0x4000, 0x8000,
|
||||
0x10000, 0x20000, 0x40000, 0x80000,
|
||||
0x100000, 0x200000, 0x400000, 0x800000,
|
||||
0x1000000, 0x2000000, 0x4000000, 0x8000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000};
|
||||
static const int g_bit_lookup[] = {0x1, 0x2, 0x4, 0x8,
|
||||
0x10, 0x20, 0x40, 0x80,
|
||||
0x100, 0x200, 0x400, 0x800,
|
||||
0x1000, 0x2000, 0x4000, 0x8000,
|
||||
0x10000, 0x20000, 0x40000, 0x80000,
|
||||
0x100000, 0x200000, 0x400000, 0x800000,
|
||||
0x1000000, 0x2000000, 0x4000000, 0x8000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000};
|
||||
|
||||
int is_data_in_parity(int data_idx, unsigned int parity_bm)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ extern struct ec_backend_common backend_liberasurecode_rs_vand;
|
||||
extern struct ec_backend_common backend_isa_l_rs_cauchy;
|
||||
extern struct ec_backend_common backend_libphazr;
|
||||
|
||||
ec_backend_t ec_backends_supported[] = {
|
||||
static ec_backend_t ec_backends_supported[] = {
|
||||
(ec_backend_t) &backend_null,
|
||||
(ec_backend_t) &backend_jerasure_rs_vand,
|
||||
(ec_backend_t) &backend_jerasure_rs_cauchy,
|
||||
@@ -66,19 +66,15 @@ ec_backend_t ec_backends_supported[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* backend list to return to the caller */
|
||||
int num_supported_backends = 0;
|
||||
char *ec_backends_supported_str[EC_BACKENDS_MAX];
|
||||
|
||||
/* =~=*=~==~=*=~==~=*=~= EC backend instance management =~=*=~==~=*=~==~=*= */
|
||||
|
||||
/* Registered erasure code backend instances */
|
||||
SLIST_HEAD(backend_list, ec_backend) active_instances =
|
||||
static SLIST_HEAD(backend_list, ec_backend) active_instances =
|
||||
SLIST_HEAD_INITIALIZER(active_instances);
|
||||
rwlock_t active_instances_rwlock = RWLOCK_INITIALIZER;
|
||||
static rwlock_t active_instances_rwlock = RWLOCK_INITIALIZER;
|
||||
|
||||
/* Backend instance id */
|
||||
int next_backend_desc = 0;
|
||||
static int next_backend_desc = 0;
|
||||
|
||||
/**
|
||||
* Look up a backend instance by descriptor
|
||||
@@ -102,7 +98,7 @@ ec_backend_t liberasurecode_backend_instance_get_by_desc(int desc)
|
||||
* Returns a unique descriptor for a new backend.
|
||||
* The caller must hold active_instances_rwlock
|
||||
*/
|
||||
int liberasurecode_backend_alloc_desc(void)
|
||||
static int liberasurecode_backend_alloc_desc(void)
|
||||
{
|
||||
for (;;) {
|
||||
if (++next_backend_desc <= 0)
|
||||
@@ -119,7 +115,7 @@ int liberasurecode_backend_alloc_desc(void)
|
||||
*
|
||||
* @returns new backend descriptor
|
||||
*/
|
||||
int liberasurecode_backend_instance_register(ec_backend_t instance)
|
||||
static int liberasurecode_backend_instance_register(ec_backend_t instance)
|
||||
{
|
||||
int desc = -1; /* descriptor to return */
|
||||
int rc = 0; /* return call value */
|
||||
@@ -146,7 +142,7 @@ exit:
|
||||
*
|
||||
* @returns 0 on success, non-0 on error
|
||||
*/
|
||||
int liberasurecode_backend_instance_unregister(ec_backend_t instance)
|
||||
static int liberasurecode_backend_instance_unregister(ec_backend_t instance)
|
||||
{
|
||||
int rc = 0; /* return call value */
|
||||
|
||||
@@ -174,7 +170,7 @@ static void print_dlerror(const char *caller)
|
||||
}
|
||||
|
||||
/* Generic dlopen/dlclose routines */
|
||||
void* liberasurecode_backend_open(ec_backend_t instance)
|
||||
static void* liberasurecode_backend_open(ec_backend_t instance)
|
||||
{
|
||||
if (NULL == instance)
|
||||
return NULL;
|
||||
@@ -182,7 +178,7 @@ void* liberasurecode_backend_open(ec_backend_t instance)
|
||||
return dlopen(instance->common.soname, RTLD_LAZY | RTLD_LOCAL);
|
||||
}
|
||||
|
||||
int liberasurecode_backend_close(ec_backend_t instance)
|
||||
static int liberasurecode_backend_close(ec_backend_t instance)
|
||||
{
|
||||
if (NULL == instance || NULL == instance->desc.backend_sohandle)
|
||||
return 0;
|
||||
@@ -200,23 +196,10 @@ void __attribute__ ((constructor))
|
||||
liberasurecode_init(void) {
|
||||
/* init logging */
|
||||
openlog("liberasurecode", LOG_PID | LOG_CONS, LOG_USER);
|
||||
|
||||
/* populate supported backends list as a string */
|
||||
{
|
||||
int i;
|
||||
for (i = 0; ec_backends_supported[i]; ++i) {
|
||||
ec_backends_supported_str[i] = strdup(
|
||||
ec_backends_supported[i]->common.name);
|
||||
}
|
||||
num_supported_backends = i;
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__ ((destructor))
|
||||
liberasurecode_exit(void) {
|
||||
int i;
|
||||
for (i = 0; i < num_supported_backends; ++i)
|
||||
free(ec_backends_supported_str[i]);
|
||||
closelog();
|
||||
}
|
||||
|
||||
@@ -1165,7 +1148,7 @@ int liberasurecode_verify_fragment_metadata(ec_backend_t be,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_invalid_fragment_metadata(int desc, fragment_metadata_t *fragment_metadata)
|
||||
static int is_invalid_fragment_metadata(int desc, fragment_metadata_t *fragment_metadata)
|
||||
{
|
||||
ec_backend_t be = liberasurecode_backend_instance_get_by_desc(desc);
|
||||
if (!be) {
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
#define GALOIS_SINGLE_MULTIPLY "galois_single_multiply"
|
||||
#define GALOIS_UNINIT "galois_uninit_field"
|
||||
|
||||
int valid_gf_w[] = { 8, 16, -1 };
|
||||
int valid_pairs[][2] = { { 8, 32}, {16, 32}, {16, 64}, {-1, -1} };
|
||||
/* valid GF w values: 8, 16 */
|
||||
static int valid_pairs[][2] = { { 8, 32}, {16, 32}, {16, 64}, {-1, -1} };
|
||||
|
||||
galois_single_multiply_func get_galois_multi_func(void *handle) {
|
||||
static galois_single_multiply_func get_galois_multi_func(void *handle) {
|
||||
/*
|
||||
* ISO C forbids casting a void* to a function pointer.
|
||||
* Since dlsym return returns a void*, we use this union to
|
||||
@@ -47,9 +47,9 @@ galois_single_multiply_func get_galois_multi_func(void *handle) {
|
||||
return func_handle.fptr;
|
||||
}
|
||||
|
||||
void stub_galois_uninit_field(int w){}
|
||||
static void stub_galois_uninit_field(int w){}
|
||||
|
||||
galois_uninit_field_func get_galois_uninit_func(void *handle) {
|
||||
static galois_uninit_field_func get_galois_uninit_func(void *handle) {
|
||||
/*
|
||||
* ISO C forbids casting a void* to a function pointer.
|
||||
* Since dlsym return returns a void*, we use this union to
|
||||
@@ -64,12 +64,12 @@ galois_uninit_field_func get_galois_uninit_func(void *handle) {
|
||||
}
|
||||
|
||||
|
||||
void *get_jerasure_sohandle(void)
|
||||
static void *get_jerasure_sohandle(void)
|
||||
{
|
||||
return dlopen(JERASURE_SONAME, RTLD_LAZY | RTLD_LOCAL);
|
||||
}
|
||||
|
||||
int load_gf_functions(void *sohandle, struct jerasure_mult_routines *routines)
|
||||
static int load_gf_functions(void *sohandle, struct jerasure_mult_routines *routines)
|
||||
{
|
||||
routines->galois_single_multiply = get_galois_multi_func(sohandle);
|
||||
routines->galois_uninit_field = get_galois_uninit_func(sohandle);
|
||||
|
||||
Reference in New Issue
Block a user