summaryrefslogtreecommitdiff
path: root/include/erasurecode/erasurecode.h
diff options
context:
space:
mode:
authorKota Tsuyuzaki <bloodeagle40234@gmail.com>2015-02-20 10:46:08 +0900
committerKota Tsuyuzaki <bloodeagle40234@gmail.com>2015-02-27 04:54:50 -0800
commit54da656c653f4d71a0b4913e2fb9f3268f1db60f (patch)
tree102176c8b9a01d23d00afe4b8105d5e84f08271e /include/erasurecode/erasurecode.h
parenta8c8ed9adbc645ffa383f57c304ebbcc3257f08f (diff)
downloadliberasurecode-54da656c653f4d71a0b4913e2fb9f3268f1db60f.tar.gz
Add liberasurecode_get_fragment_size function
For get_segment_info function of PyECLib, liberasurecode should support get_fragment_size function because if pyeclib and liberasurecode have the calculation of fragment size each other, it might cause the size mismatch (i.e. it'll be a bug) in the future development work. This patch introduces liberasurecode_get_fragment_size function to return the fragment_size calculated at liberasurecode accoring to specified backend descriptor. It really usefull to help caller knows how large size it have to expect and all pyeclib has to do for retrieving fragment_size will be just calling the liberasurecode_get_fragment_size function on get_segment_info.
Diffstat (limited to 'include/erasurecode/erasurecode.h')
-rw-r--r--include/erasurecode/erasurecode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/erasurecode/erasurecode.h b/include/erasurecode/erasurecode.h
index f811555..7dc7ba7 100644
--- a/include/erasurecode/erasurecode.h
+++ b/include/erasurecode/erasurecode.h
@@ -328,6 +328,18 @@ int liberasurecode_get_aligned_data_size(int desc, uint64_t data_len);
*/
int liberasurecode_get_minimum_encode_size(int desc);
+/**
+ * This will return the fragment size, which is each fragment data
+ * length the backend will allocate when encoding.
+ *
+ * @param desc - liberasurecode descriptor/handle
+ * from liberasurecode_instance_create()
+ * @param data_len - original data length in bytes
+ *
+ * @return fragment size
+ */
+int liberasurecode_get_fragment_size(int desc, int data_len);
+
/* ==~=*=~===~=*=~==~=*=~== liberasurecode Error codes =~=*=~==~=~=*=~==~== */
/* Error codes */