|
liberasurecode
1.6.2
Erasure Code API library
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "xor_code.h"#include "xor_hd_code_defs.h"Go to the source code of this file.
Functions | |
| static int | fragments_needed_one_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm) |
| static int | fragments_needed_two_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm) |
| static int | fragments_needed_three_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm) |
| static int | fragments_needed_one_data_local (xor_code_t *code_desc, int fragment_to_reconstruct, int *fragments_to_exclude, unsigned int *data_bm, unsigned int *parity_bm) |
| int | xor_hd_fragments_needed (xor_code_t *code_desc, int *fragments_to_reconstruct, int *fragments_to_exclude, int *fragments_needed) |
| static void | decode_one_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize) |
| static int | decode_two_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize) |
| static int | decode_three_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize) |
| int | xor_hd_decode (xor_code_t *code_desc, char **data, char **parity, int *missing_idxs, int blocksize, int decode_parity) |
| xor_code_t * | init_xor_hd_code (int k, int m, int hd) |
|
static |
Definition at line 412 of file xor_hd_code.c.
References fast_memcpy(), index_of_connected_parity(), is_data_in_parity(), and xor_bufs_and_store().
Referenced by decode_two_data(), and xor_hd_decode().
|
static |
Definition at line 462 of file xor_hd_code.c.
References decode_two_data(), fast_memcpy(), index_of_connected_parity(), is_data_in_parity(), num_missing_data_in_parity(), remove_from_missing_list(), and xor_bufs_and_store().
Referenced by xor_hd_decode().
|
static |
Definition at line 429 of file xor_hd_code.c.
References decode_one_data(), fast_memcpy(), index_of_connected_parity(), is_data_in_parity(), and xor_bufs_and_store().
Referenced by decode_three_data(), and xor_hd_decode().
|
static |
Definition at line 34 of file xor_hd_code.c.
References index_of_connected_parity().
Referenced by fragments_needed_two_data(), and xor_hd_fragments_needed().
|
static |
Definition at line 176 of file xor_hd_code.c.
References get_missing_data(), get_missing_parity(), and index_of_connected_parity().
Referenced by xor_hd_fragments_needed().
|
static |
Definition at line 91 of file xor_hd_code.c.
References fragments_needed_two_data(), index_of_connected_parity(), is_data_in_parity(), num_missing_data_in_parity(), and remove_from_missing_list().
Referenced by xor_hd_fragments_needed().
|
static |
Definition at line 56 of file xor_hd_code.c.
References fragments_needed_one_data(), and index_of_connected_parity().
Referenced by fragments_needed_three_data(), and xor_hd_fragments_needed().
| xor_code_t* init_xor_hd_code | ( | int | k, |
| int | m, | ||
| int | hd | ||
| ) |
Definition at line 653 of file xor_hd_code.c.
References xor_code_encode(), xor_hd_decode(), and xor_hd_fragments_needed().
Referenced by flat_xor_hd_init().
| int xor_hd_decode | ( | xor_code_t * | code_desc, |
| char ** | data, | ||
| char ** | parity, | ||
| int * | missing_idxs, | ||
| int | blocksize, | ||
| int | decode_parity | ||
| ) |
Definition at line 559 of file xor_hd_code.c.
References decode_one_data(), decode_three_data(), decode_two_data(), get_failure_pattern(), get_missing_data(), get_missing_parity(), and selective_encode().
Referenced by init_xor_hd_code().
| int xor_hd_fragments_needed | ( | xor_code_t * | code_desc, |
| int * | fragments_to_reconstruct, | ||
| int * | fragments_to_exclude, | ||
| int * | fragments_needed | ||
| ) |
Re-visit this decision (KMG): This is non-optimal, but good enough in most cases. If there is a single data item to reconstruct, then try to find a connected parity with no items in fragments_to_exclude. If there is a single parity item to reconsturct or more than 1 data/parity element missing, then just work fragments_to_exclude into missing_idxs.
There is either more than one failed element, a failed parity element or we were unable to return the fragments needed for a simple reconstruction.
Add everything to missing_idxs (basically, give up on optimizing).
Definition at line 202 of file xor_hd_code.c.
References data_bit_lookup(), fragments_needed_one_data(), fragments_needed_one_data_local(), fragments_needed_three_data(), fragments_needed_two_data(), get_failure_pattern(), get_missing_data(), get_missing_parity(), and missing_elements_bm().
Referenced by init_xor_hd_code().