diff options
author | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-17 19:55:52 -0700 |
---|---|---|
committer | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-17 19:55:52 -0700 |
commit | f033e1c74201648e7b1de7b9a63a184e76bc14f4 (patch) | |
tree | ab5b78de9c594f7191a3d6f41e1c2a8b7808818d /include/erasurecode | |
parent | 4cb9e34c7676d3b065b5ad1000a6065797ba6eae (diff) | |
download | liberasurecode-f033e1c74201648e7b1de7b9a63a184e76bc14f4.tar.gz |
Move encode() helpers to common preprocessing code
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
Diffstat (limited to 'include/erasurecode')
-rw-r--r-- | include/erasurecode/erasurecode_helpers.h | 23 | ||||
-rw-r--r-- | include/erasurecode/erasurecode_preprocessing.h | 34 |
2 files changed, 35 insertions, 22 deletions
diff --git a/include/erasurecode/erasurecode_helpers.h b/include/erasurecode/erasurecode_helpers.h index b0e8394..8265bdc 100644 --- a/include/erasurecode/erasurecode_helpers.h +++ b/include/erasurecode/erasurecode_helpers.h @@ -21,7 +21,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * liberasurecode API helpers header + * liberasurecode proprocssing helpers header * * vi: set noai tw=79 ts=4 sw=4: */ @@ -46,7 +46,8 @@ #endif #endif -#define log_error(str) fprintf(stderr, "%s:%d (%s): %s\n", __FILE__, __LINE__, __func__, str) +#define log_error(str) \ + fprintf(stderr, "%s:%d (%s): %s\n", __FILE__, __LINE__, __func__, str) /* * Prevent the compiler from padding @@ -54,15 +55,15 @@ */ typedef struct __attribute__((__packed__)) fragment_header_s { - uint32_t magic; - uint32_t idx; - uint32_t size; - uint32_t orig_data_size; - // FIXME - reserve 16-bytes for md5 - uint32_t chksum; - // We must be aligned to 16-byte boundaries - // So, size this array accordingly - uint32_t aligned_padding[3]; + uint32_t magic; + uint32_t idx; + uint32_t size; + uint32_t orig_data_size; + // FIXME - reserve 16-bytes for md5 + uint32_t chksum; + // We must be aligned to 16-byte boundaries + // So, size this array accordingly + uint32_t aligned_padding[3]; } fragment_header_t; /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ diff --git a/include/erasurecode/erasurecode_preprocessing.h b/include/erasurecode/erasurecode_preprocessing.h index 9dec88b..667f791 100644 --- a/include/erasurecode/erasurecode_preprocessing.h +++ b/include/erasurecode/erasurecode_preprocessing.h @@ -29,17 +29,29 @@ #ifndef _ERASURECODE_PREPROCESSING_H_ #define _ERASURECODE_PREPROCESSING_H_ -int prepare_fragments_for_decode(int k, - int m, - char **data, - char **parity, - int *missing_idxs, - int *orig_size, - int *fragment_payload_size, - int fragment_size, - uint64_t *realloc_bm); +int prepare_fragments_for_encode( + ec_backend_t instance, + int k, int m, + const char *orig_data, uint64_t orig_data_size, /* input */ + char **encoded_data, char **encoded_parity, /* output */ + int *blocksize); -int get_fragment_partition(int k, int m, char **fragments, int num_fragments, char **data, char **parity, int *missing); -int fragments_to_string(int k, int m, char **fragments, int num_fragments, char **orig_payload, int *payload_len); +int prepare_fragments_for_decode( + int k, int m, + char **data, char **parity, + int *missing_idxs, + int *orig_size, int *fragment_payload_size, int fragment_size, + uint64_t *realloc_bm); + +int get_fragment_partition( + int k, int m, + char **fragments, int num_fragments, + char **data, char **parity, + int *missing); + +int fragments_to_string( + int k, int m, + char **fragments, int num_fragments, + char **orig_payload, int *payload_len); #endif |