summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin Greenan <kmgreen2@gmail.com>2014-07-21 08:53:59 -0700
committerKevin Greenan <kmgreen2@gmail.com>2014-07-21 09:10:33 -0700
commitbf219bde4f8decf64de52f46cc9af3eae513edf6 (patch)
treefce65906811b30ed22395832b771c29e411e408e /include
parent19cd7d3b4960b8f28258e36fe2a42e8301b3c358 (diff)
downloadliberasurecode-bf219bde4f8decf64de52f46cc9af3eae513edf6.tar.gz
Added functionality needed to support the get_segment_info() API in PyECLib.
Diffstat (limited to 'include')
-rw-r--r--include/erasurecode/erasurecode.h15
-rw-r--r--include/erasurecode/erasurecode_backend.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/include/erasurecode/erasurecode.h b/include/erasurecode/erasurecode.h
index 38c50d3..c92c9e4 100644
--- a/include/erasurecode/erasurecode.h
+++ b/include/erasurecode/erasurecode.h
@@ -194,6 +194,21 @@ int liberasurecode_get_fragment_metadata(char *fragment);
*/
int liberasurecode_verify_stripe_metadata(char **fragments);
+/**
+ * This computes the aligned size of a buffer passed into
+ * the encode function. The encode function must pad fragments
+ * to be algined with the word size (w) and the last fragment also
+ * needs to be aligned. This computes the sum of the algined fragment
+ * sizes for a given buffer to encode.
+ */
+int liberasurecode_get_aligned_data_size(int desc, int data_len);
+
+/**
+ * This will return the minumum encode size, which is the minimum
+ * buffer size that can be encoded.
+ */
+int liberasurecode_get_minimum_encode_size(int desc);
+
/* ==~=*=~===~=*=~==~=*=~== liberasurecode Error codes =~=*=~==~=~=*=~==~== */
diff --git a/include/erasurecode/erasurecode_backend.h b/include/erasurecode/erasurecode_backend.h
index bf35e0d..c5ead2a 100644
--- a/include/erasurecode/erasurecode_backend.h
+++ b/include/erasurecode/erasurecode_backend.h
@@ -58,6 +58,7 @@ struct ec_backend_args {
#define DECODE decode
#define FRAGSNEEDED fragments_needed
#define RECONSTRUCT reconstruct
+#define ELEMENTSIZE element_size
#define FN_NAME(s) str(s)
#define str(s) #s
@@ -82,6 +83,7 @@ struct ec_backend_op_stubs {
int (*RECONSTRUCT)(void *desc,
char **data, char **parity, int *missing_idxs, int destination_idx,
int blocksize);
+ int (*ELEMENTSIZE)(void *desc);
};
/* ==~=*=~==~=*=~==~=*=~= backend struct definitions =~=*=~==~=*=~==~=*==~== */