summaryrefslogtreecommitdiff
path: root/include/erasurecode/erasurecode_helpers.h
Commit message (Collapse)AuthorAgeFilesLines
* Split helpers.h include for backward compatibilityTushar Gohad2015-09-221-38/+1
| | | | | | | Users of liberasurecode <= 1.0.7 used alloc/free helpers (which they shouldn't have). This change is to make sure we are still able to those older revs of programs and they work with newer liberasurecode.
* Move fragment_header defn to main erasurecode headerTushar Gohad2015-09-171-22/+1
|
* Rename frag_adder_sizeKota Tsuyuzaki2015-03-051-2/+2
| | | | | | | | This patch renames following variables and functions: - frag_adder_size -> frag_backend_metadata_size - set_fragment_adder_size() -> set_fragment_backend_metadata_size() - get_fragment_adder_size() -> get_fragment_backend_metadata_size()
* Enable to get fragment_len includes metadata_adderKota Tsuyuzaki2015-02-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to get correct fragment size includes metadata_adder. Current implementaion automatically allocates extra bytes for the metadata_adder in alloc_buffer, and then, no information about the extra bytes will be returned to the api caller side. It's too confusable because callers couldn't know how size they assumes as the fragment size. To be easy to find out the size infomation, this patch adds "frag_adder_size" variable into fragment metadata and also some functions to get fragment size. The definitions of these size infomation are here, fragment_meta: - size-> raw data size used to encode/fragment_to_string - frag_adder_size-> metadata_adder of backend specification And the definitions of functions are here, - get_fragment_size: -> return sizeof(fragument_header) + size + frag_adder_size - get_fragment_buffer_size: -> return size + frag_adder_size - get_fragment_payload_size: -> return size By using these function above, users could get the size information directly from fragments. It results in enabling to return fragment_len to the caller side easily.
* Move backend metadata adding to fragment allocationKota Tsuyuzaki2015-02-271-1/+1
| | | | | | | | | | | | | | On the first consideration[1], metadata_adder is defined as a extra byte size for "each" fragment. However, current implementation is an element affects to data_len. (i.e. aligned_data_size for original segment data) We should make metadata_adder to be a fixed value against to each fragment, otherwise the extra bytes for the fragments will have flexible length depends on "K". It will be quite complex for backend implementation to know "How large bytes the raw data size is", "How large bytes the backend could use as extra bytes for each fragment". 1: https://bitbucket.org/tsg-/liberasurecode/commits/032b57d9b1c7aadc547fccbacf88af786c9067e7?at=master
* Ensure fragment pointers passed to cleanupKota Tsuyuzaki2015-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch achieves a couple of things as follows: - Undoing the liberasurecode_encode_cleanup specification to expect "fragment" pointers as its arguments. - Ensuring liberasurecode_encode to pass "fratment" pointers to liberasurecode_encode_cleanup. liberasurecode_encode_cleanup is used also in pyeclib so that it is expected that the argument pointers (i.e. encoded_data and encoded_parity) should be the collection of the heads of "fragment" pointers. However, when the backend encode fails, liberasurecode keeps "data" pointers behind of fragment_header, and then, goes to "out:" statement to cleanup its memories. It causes invalid pointer failure. This patch adds a translation function from "data" pointers to "fragment" pointers and ensure liberasurecode_encode to pass correct pointers to libersurecode_encode_cleanup.
* add fragment validationEric Lambert2014-11-091-2/+1
|
* add backend_id and backend_version to fragment metadataEric Lambert2014-10-031-0/+4
|
* libec version is now stored in fragment headerEric Lambert2014-10-021-2/+5
|
* crc32 checksum now supported (prior to this commit checksum values wereEric Lambert2014-09-251-1/+1
| | | | not being placed into the fragment header).
* Compile in pedantic mode and fail compilation on warnings. Also cleanup all ↵Eric Lambert2014-09-101-1/+1
| | | | existing warnings.
* Split metadata handling into own routine, add crc32 supportTushar Gohad2014-08-071-10/+9
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Created helper function to iterate over a set of data/parity fragmentsEric Lambert2014-07-291-0/+1
| | | | | and create an array of pointers to the data segments for each fragment (this array can then be passed to backend decode functions).
* Buffers that hold missing indexes need to be '-1 terminated'Eric Lambert2014-07-291-0/+1
|
* gf: Convert exit(1)s to return statementsTushar Gohad2014-07-211-21/+0
| | | | | | ... shared library should not call exit() Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Add encode postprocessing, checksum helpersTushar Gohad2014-07-211-0/+2
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* API to get total fragment sizeTushar Gohad2014-07-211-2/+3
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Allow varargs in log messages, use log_error in more placesTushar Gohad2014-07-181-4/+4
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Add syslog based logging routinesTushar Gohad2014-07-181-3/+11
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Rename header magic macroTushar Gohad2014-07-181-8/+11
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Move encode() helpers to common preprocessing codeTushar Gohad2014-07-171-11/+12
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Add preprocessing for decode and reconstruct.Kevin Greenan2014-07-191-0/+10
| | | | | I'll fill-in the details of decode and reconstruct in a separate commit.
* Add preprocessing code for main encode() routineTushar Gohad2014-07-171-0/+2
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Add helper prototypes to erasurecode_helpers.hTushar Gohad2014-07-171-7/+29
| | | | Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
* Add liberasurecode helpers (take 1)Tushar Gohad2014-07-171-0/+115
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>