summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTushar Gohad <tushar.gohad@intel.com>2014-09-30 06:35:03 -0700
committerTushar Gohad <tushar.gohad@intel.com>2014-09-30 07:15:16 -0700
commit032b57d9b1c7aadc547fccbacf88af786c9067e7 (patch)
treef007a6716585434a77de352601a6525428939c7b /include
parent6c8d66e68beee67f81812a21cc69d73ff7b2b0b5 (diff)
downloadliberasurecode-backend_metadata_adder.tar.gz
Add support for custom backend metadatabackend_metadata_adder
A backend may have the need to add custom metadata to the encoded data/parity fragments, in addition to the liberasurecode "fragment metadata headers". This patch gives the ability to a EC backend writer to specify a "metadata adder" that is taken into account when allocating output data/parity fragment buffers. Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/erasurecode/erasurecode_backend.h4
-rw-r--r--include/erasurecode/erasurecode_helpers.h2
-rw-r--r--include/erasurecode/erasurecode_preprocessing.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/include/erasurecode/erasurecode_backend.h b/include/erasurecode/erasurecode_backend.h
index a6e4440..956b2f1 100644
--- a/include/erasurecode/erasurecode_backend.h
+++ b/include/erasurecode/erasurecode_backend.h
@@ -106,6 +106,10 @@ struct ec_backend_common {
char soversion[MAX_LEN]; /* EC backend shared library version */
struct ec_backend_op_stubs *ops; /* EC backend stubs */
+ int metadata_adder; /* EC backend custom metadata adder -
+ * metadata_adder bytes are added to
+ * the fragment size when allocating
+ * data/parity fragment buffers */
};
/* EC backend definition */
diff --git a/include/erasurecode/erasurecode_helpers.h b/include/erasurecode/erasurecode_helpers.h
index e8fddaa..46dc669 100644
--- a/include/erasurecode/erasurecode_helpers.h
+++ b/include/erasurecode/erasurecode_helpers.h
@@ -118,7 +118,7 @@ void init_fragment_header(char *buf)
void *alloc_zeroed_buffer(int size);
void *alloc_and_set_buffer(int size, int value);
void *check_and_free_buffer(void *buf);
-char *alloc_fragment_buffer(int size);
+char *alloc_fragment_buffer(ec_backend_t instance, int size);
int free_fragment_buffer(char *buf);
void *get_aligned_buffer16(int size);
int get_aligned_data_size(ec_backend_t instance, int data_len);
diff --git a/include/erasurecode/erasurecode_preprocessing.h b/include/erasurecode/erasurecode_preprocessing.h
index 7ca891d..0b479c6 100644
--- a/include/erasurecode/erasurecode_preprocessing.h
+++ b/include/erasurecode/erasurecode_preprocessing.h
@@ -37,6 +37,7 @@ int prepare_fragments_for_encode(
int *blocksize);
int prepare_fragments_for_decode(
+ ec_backend_t instance,
int k, int m,
char **data, char **parity,
int *missing_idxs,