summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rs_vand/liberasurecode_rs_vand.h (renamed from include/rs_vand/rs_vand_internal.h)10
-rw-r--r--src/Makefile.am4
-rw-r--r--src/backends/rs_vand/liberasurecode_rs_vand.c (renamed from src/backends/rs_vand/rs_vand.c)150
-rw-r--r--src/builtin/rs_vand/Makefile.am2
-rw-r--r--src/builtin/rs_vand/liberasurecode_rs_vand.c (renamed from src/builtin/rs_vand/rs_vand_internal.c)12
-rw-r--r--src/erasurecode.c4
-rw-r--r--test/Makefile.am10
-rw-r--r--test/builtin/rs_vand/liberasurecode_rs_vand_test.c (renamed from test/builtin/rs_vand/rs_vand_internal_test.c)14
-rw-r--r--test/liberasurecode_test.c60
9 files changed, 134 insertions, 132 deletions
diff --git a/include/rs_vand/rs_vand_internal.h b/include/rs_vand/liberasurecode_rs_vand.h
index c545333..97c0cc8 100644
--- a/include/rs_vand/rs_vand_internal.h
+++ b/include/rs_vand/liberasurecode_rs_vand.h
@@ -33,12 +33,12 @@ int get_non_zero_diagonal(int *matrix, int row, int num_rows, int num_cols);
int rs_galois_div(int x, int y);
int rs_galois_inverse(int x);
int rs_galois_mult(int x, int y);
-void init_rs_vand(int k, int m);
-void deinit_rs_vand();
+void init_liberasurecode_rs_vand(int k, int m);
+void deinit_liberasurecode_rs_vand();
void print_matrix(int *matrix, int rows, int cols);
void square_matrix_multiply(int *m1, int *m2, int *prod, int n);
int create_decoding_matrix(int *gen_matrix, int *dec_matrix, int *missing_idxs, int k, int m);
int is_identity_matrix(int *matrix, int n);
-int internal_rs_vand_encode(int *generator_matrix, char **data, char **parity, int k, int m, int blocksize);
-int internal_rs_vand_decode(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int blocksize, int rebuild_parity);
-int internal_rs_vand_reconstruct(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int destination_idx, int blocksize);
+int liberasurecode_rs_vand_encode(int *generator_matrix, char **data, char **parity, int k, int m, int blocksize);
+int liberasurecode_rs_vand_decode(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int blocksize, int rebuild_parity);
+int liberasurecode_rs_vand_reconstruct(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int destination_idx, int blocksize);
diff --git a/src/Makefile.am b/src/Makefile.am
index 9c90b30..e4ba048 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,12 +21,12 @@ liberasurecode_la_SOURCES = \
backends/jerasure/jerasure_rs_vand.c \
backends/jerasure/jerasure_rs_cauchy.c \
backends/isa-l/isa_l_rs_vand.c \
- backends/rs_vand/rs_vand.c \
+ backends/rs_vand/liberasurecode_rs_vand.c \
backends/shss/shss.c
liberasurecode_la_CPPFLAGS = -Werror @GCOV_FLAGS@
liberasurecode_la_LIBADD = \
- builtin/null_code/libnullcode.la -lpthread -lm @GCOV_LDFLAGS@ \
+ builtin/null_code/libnullcode.la -lpthread -lm @GCOV_LDFLAGS@ \
builtin/xor_codes/libXorcode.la -lpthread -lm @GCOV_LDFLAGS@ \
builtin/rs_vand/liberasurecode_rsvand.la -lpthread -lm @GCOV_LDFLAGS@
diff --git a/src/backends/rs_vand/rs_vand.c b/src/backends/rs_vand/liberasurecode_rs_vand.c
index e39564f..8a09e9a 100644
--- a/src/backends/rs_vand/rs_vand.c
+++ b/src/backends/rs_vand/liberasurecode_rs_vand.c
@@ -43,34 +43,34 @@
#endif
/* Forward declarations */
-struct ec_backend_op_stubs internal_rs_vand_ops;
-struct ec_backend internal_rs_vand;
-struct ec_backend_common backend_internal_rs_vand;
-
-typedef int (*internal_rs_vand_encode_func)(int *, char **, char **, int, int, int);
-typedef int (*internal_rs_vand_decode_func)(int *, char **, char **, int, int, int *, int, int);
-typedef int (*internal_rs_vand_reconstruct_func)(int *, char **, char **, int, int, int *, int, int);
-typedef void (*init_rs_vand_func)(int, int);
-typedef void (*deinit_rs_vand_func)();
+struct ec_backend_op_stubs liberasurecode_rs_vand_ops;
+struct ec_backend liberasurecode_rs_vand;
+struct ec_backend_common backend_liberasurecode_rs_vand;
+
+typedef int (*liberasurecode_rs_vand_encode_func)(int *, char **, char **, int, int, int);
+typedef int (*liberasurecode_rs_vand_decode_func)(int *, char **, char **, int, int, int *, int, int);
+typedef int (*liberasurecode_rs_vand_reconstruct_func)(int *, char **, char **, int, int, int *, int, int);
+typedef void (*init_liberasurecode_rs_vand_func)(int, int);
+typedef void (*deinit_liberasurecode_rs_vand_func)();
typedef void (*free_systematic_matrix_func)(int *);
typedef int* (*make_systematic_matrix_func)(int, int);
-struct internal_rs_vand_descriptor {
+struct liberasurecode_rs_vand_descriptor {
/* calls required for init */
- init_rs_vand_func init_rs_vand;
- deinit_rs_vand_func deinit_rs_vand;
+ init_liberasurecode_rs_vand_func init_liberasurecode_rs_vand;
+ deinit_liberasurecode_rs_vand_func deinit_liberasurecode_rs_vand;
free_systematic_matrix_func free_systematic_matrix;
make_systematic_matrix_func make_systematic_matrix;
/* calls required for encode */
- internal_rs_vand_encode_func internal_rs_vand_encode;
+ liberasurecode_rs_vand_encode_func liberasurecode_rs_vand_encode;
/* calls required for decode */
- internal_rs_vand_decode_func internal_rs_vand_decode;
+ liberasurecode_rs_vand_decode_func liberasurecode_rs_vand_decode;
/* calls required for reconstruct */
- internal_rs_vand_reconstruct_func internal_rs_vand_reconstruct;
+ liberasurecode_rs_vand_reconstruct_func liberasurecode_rs_vand_reconstruct;
/* fields needed to hold state */
int *matrix;
@@ -79,49 +79,49 @@ struct internal_rs_vand_descriptor {
int w;
};
-static int internal_rs_vand_encode(void *desc, char **data, char **parity,
+static int liberasurecode_rs_vand_encode(void *desc, char **data, char **parity,
int blocksize)
{
- struct internal_rs_vand_descriptor *rs_vand_desc =
- (struct internal_rs_vand_descriptor*) desc;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc =
+ (struct liberasurecode_rs_vand_descriptor*) desc;
/* FIXME: Should this return something? */
- rs_vand_desc->internal_rs_vand_encode(rs_vand_desc->matrix, data, parity,
+ rs_vand_desc->liberasurecode_rs_vand_encode(rs_vand_desc->matrix, data, parity,
rs_vand_desc->k, rs_vand_desc->m, blocksize);
return 0;
}
-static int internal_rs_vand_decode(void *desc, char **data, char **parity,
+static int liberasurecode_rs_vand_decode(void *desc, char **data, char **parity,
int *missing_idxs, int blocksize)
{
- struct internal_rs_vand_descriptor *rs_vand_desc =
- (struct internal_rs_vand_descriptor*) desc;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc =
+ (struct liberasurecode_rs_vand_descriptor*) desc;
/* FIXME: Should this return something? */
- rs_vand_desc->internal_rs_vand_decode(rs_vand_desc->matrix, data, parity,
+ rs_vand_desc->liberasurecode_rs_vand_decode(rs_vand_desc->matrix, data, parity,
rs_vand_desc->k, rs_vand_desc->m, missing_idxs, blocksize, 1);
return 0;
}
-static int internal_rs_vand_reconstruct(void *desc, char **data, char **parity,
+static int liberasurecode_rs_vand_reconstruct(void *desc, char **data, char **parity,
int *missing_idxs, int destination_idx, int blocksize)
{
- struct internal_rs_vand_descriptor *rs_vand_desc =
- (struct internal_rs_vand_descriptor*) desc;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc =
+ (struct liberasurecode_rs_vand_descriptor*) desc;
/* FIXME: Should this return something? */
- rs_vand_desc->internal_rs_vand_reconstruct(rs_vand_desc->matrix, data, parity,
+ rs_vand_desc->liberasurecode_rs_vand_reconstruct(rs_vand_desc->matrix, data, parity,
rs_vand_desc->k, rs_vand_desc->m, missing_idxs, destination_idx, blocksize);
return 0;
}
-static int internal_rs_vand_min_fragments(void *desc, int *missing_idxs,
+static int liberasurecode_rs_vand_min_fragments(void *desc, int *missing_idxs,
int *fragments_to_exclude, int *fragments_needed)
{
- struct internal_rs_vand_descriptor *rs_vand_desc =
- (struct internal_rs_vand_descriptor*)desc;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc =
+ (struct liberasurecode_rs_vand_descriptor*)desc;
uint64_t exclude_bm = convert_list_to_bitmap(fragments_to_exclude);
uint64_t missing_bm = convert_list_to_bitmap(missing_idxs) | exclude_bm;
@@ -144,13 +144,13 @@ static int internal_rs_vand_min_fragments(void *desc, int *missing_idxs,
return ret;
}
-static void * internal_rs_vand_init(struct ec_backend_args *args,
+static void * liberasurecode_rs_vand_init(struct ec_backend_args *args,
void *backend_sohandle)
{
- struct internal_rs_vand_descriptor *desc = NULL;
+ struct liberasurecode_rs_vand_descriptor *desc = NULL;
- desc = (struct internal_rs_vand_descriptor *)
- malloc(sizeof(struct internal_rs_vand_descriptor));
+ desc = (struct liberasurecode_rs_vand_descriptor *)
+ malloc(sizeof(struct liberasurecode_rs_vand_descriptor));
if (NULL == desc) {
return NULL;
}
@@ -173,29 +173,29 @@ static void * internal_rs_vand_init(struct ec_backend_args *args,
* "transform" the void* to a function pointer.
*/
union {
- init_rs_vand_func initp;
- deinit_rs_vand_func deinitp;
+ init_liberasurecode_rs_vand_func initp;
+ deinit_liberasurecode_rs_vand_func deinitp;
free_systematic_matrix_func freematrixp;
make_systematic_matrix_func makematrixp;
- internal_rs_vand_encode_func encodep;
- internal_rs_vand_decode_func decodep;
- internal_rs_vand_reconstruct_func reconstructp;
+ liberasurecode_rs_vand_encode_func encodep;
+ liberasurecode_rs_vand_decode_func decodep;
+ liberasurecode_rs_vand_reconstruct_func reconstructp;
void *vptr;
} func_handle = {.vptr = NULL};
/* fill in function addresses */
func_handle.vptr = NULL;
- func_handle.vptr = dlsym(backend_sohandle, "init_rs_vand");
- desc->init_rs_vand = func_handle.initp;
- if (NULL == desc->init_rs_vand) {
+ func_handle.vptr = dlsym(backend_sohandle, "init_liberasurecode_rs_vand");
+ desc->init_liberasurecode_rs_vand = func_handle.initp;
+ if (NULL == desc->init_liberasurecode_rs_vand) {
goto error;
}
func_handle.vptr = NULL;
- func_handle.vptr = dlsym(backend_sohandle, "deinit_rs_vand");
- desc->deinit_rs_vand = func_handle.deinitp;
- if (NULL == desc->deinit_rs_vand) {
+ func_handle.vptr = dlsym(backend_sohandle, "deinit_liberasurecode_rs_vand");
+ desc->deinit_liberasurecode_rs_vand = func_handle.deinitp;
+ if (NULL == desc->deinit_liberasurecode_rs_vand) {
goto error;
}
@@ -214,27 +214,27 @@ static void * internal_rs_vand_init(struct ec_backend_args *args,
}
func_handle.vptr = NULL;
- func_handle.vptr = dlsym(backend_sohandle, "internal_rs_vand_encode");
- desc->internal_rs_vand_encode = func_handle.encodep;
- if (NULL == desc->internal_rs_vand_encode) {
+ func_handle.vptr = dlsym(backend_sohandle, "liberasurecode_rs_vand_encode");
+ desc->liberasurecode_rs_vand_encode = func_handle.encodep;
+ if (NULL == desc->liberasurecode_rs_vand_encode) {
goto error;
}
func_handle.vptr = NULL;
- func_handle.vptr = dlsym(backend_sohandle, "internal_rs_vand_decode");
- desc->internal_rs_vand_decode = func_handle.decodep;
- if (NULL == desc->internal_rs_vand_decode) {
+ func_handle.vptr = dlsym(backend_sohandle, "liberasurecode_rs_vand_decode");
+ desc->liberasurecode_rs_vand_decode = func_handle.decodep;
+ if (NULL == desc->liberasurecode_rs_vand_decode) {
goto error;
}
func_handle.vptr = NULL;
- func_handle.vptr = dlsym(backend_sohandle, "internal_rs_vand_reconstruct");
- desc->internal_rs_vand_reconstruct = func_handle.reconstructp;
- if (NULL == desc->internal_rs_vand_reconstruct) {
+ func_handle.vptr = dlsym(backend_sohandle, "liberasurecode_rs_vand_reconstruct");
+ desc->liberasurecode_rs_vand_reconstruct = func_handle.reconstructp;
+ if (NULL == desc->liberasurecode_rs_vand_reconstruct) {
goto error;
}
- desc->init_rs_vand(desc->k, desc->m);
+ desc->init_liberasurecode_rs_vand(desc->k, desc->m);
desc->matrix = desc->make_systematic_matrix(desc->k, desc->m);
@@ -258,23 +258,23 @@ error:
* Returns the size in bits!
*/
static int
-internal_rs_vand_element_size(void* desc)
+liberasurecode_rs_vand_element_size(void* desc)
{
- struct internal_rs_vand_descriptor *rs_vand_desc = NULL;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc = NULL;
- rs_vand_desc = (struct internal_rs_vand_descriptor*) desc;
+ rs_vand_desc = (struct liberasurecode_rs_vand_descriptor*) desc;
return rs_vand_desc->w;
}
-static int internal_rs_vand_exit(void *desc)
+static int liberasurecode_rs_vand_exit(void *desc)
{
- struct internal_rs_vand_descriptor *rs_vand_desc = NULL;
+ struct liberasurecode_rs_vand_descriptor *rs_vand_desc = NULL;
- rs_vand_desc = (struct internal_rs_vand_descriptor*) desc;
+ rs_vand_desc = (struct liberasurecode_rs_vand_descriptor*) desc;
rs_vand_desc->free_systematic_matrix(rs_vand_desc->matrix);
- rs_vand_desc->deinit_rs_vand();
+ rs_vand_desc->deinit_liberasurecode_rs_vand();
free(rs_vand_desc);
return 0;
@@ -284,27 +284,27 @@ static int internal_rs_vand_exit(void *desc)
* For the time being, we only claim compatibility with versions that
* match exactly
*/
-static bool internal_rs_vand_is_compatible_with(uint32_t version) {
- return version == backend_internal_rs_vand.ec_backend_version;
+static bool liberasurecode_rs_vand_is_compatible_with(uint32_t version) {
+ return version == backend_liberasurecode_rs_vand.ec_backend_version;
}
-struct ec_backend_op_stubs internal_rs_vand_op_stubs = {
- .INIT = internal_rs_vand_init,
- .EXIT = internal_rs_vand_exit,
- .ENCODE = internal_rs_vand_encode,
- .DECODE = internal_rs_vand_decode,
- .FRAGSNEEDED = internal_rs_vand_min_fragments,
- .RECONSTRUCT = internal_rs_vand_reconstruct,
- .ELEMENTSIZE = internal_rs_vand_element_size,
- .ISCOMPATIBLEWITH = internal_rs_vand_is_compatible_with,
+struct ec_backend_op_stubs liberasurecode_rs_vand_op_stubs = {
+ .INIT = liberasurecode_rs_vand_init,
+ .EXIT = liberasurecode_rs_vand_exit,
+ .ENCODE = liberasurecode_rs_vand_encode,
+ .DECODE = liberasurecode_rs_vand_decode,
+ .FRAGSNEEDED = liberasurecode_rs_vand_min_fragments,
+ .RECONSTRUCT = liberasurecode_rs_vand_reconstruct,
+ .ELEMENTSIZE = liberasurecode_rs_vand_element_size,
+ .ISCOMPATIBLEWITH = liberasurecode_rs_vand_is_compatible_with,
};
-struct ec_backend_common backend_internal_rs_vand = {
+struct ec_backend_common backend_liberasurecode_rs_vand = {
.id = EC_BACKEND_INTERNAL_RS_VAND,
.name = INTERNAL_RS_VAND_LIB_NAME,
.soname = INTERNAL_RS_VAND_SO_NAME,
.soversion = INTERNAL_RS_VAND_LIB_VER_STR,
- .ops = &internal_rs_vand_op_stubs,
+ .ops = &liberasurecode_rs_vand_op_stubs,
.backend_metadata_size = 0,
.ec_backend_version = _VERSION(INTERNAL_RS_VAND_LIB_MAJOR,
INTERNAL_RS_VAND_LIB_MINOR,
diff --git a/src/builtin/rs_vand/Makefile.am b/src/builtin/rs_vand/Makefile.am
index de6f802..386f706 100644
--- a/src/builtin/rs_vand/Makefile.am
+++ b/src/builtin/rs_vand/Makefile.am
@@ -1,7 +1,7 @@
lib_LTLIBRARIES = liberasurecode_rsvand.la
# liberasurecode_rsvand params
-liberasurecode_rsvand_la_SOURCES = rs_galois.c rs_vand_internal.c
+liberasurecode_rsvand_la_SOURCES = rs_galois.c liberasurecode_rs_vand.c
liberasurecode_rsvand_la_CPPFLAGS = -I$(top_srcdir)/include/rs_vand @GCOV_FLAGS@
# Version format (C - A).(A).(R) for C:R:A input
diff --git a/src/builtin/rs_vand/rs_vand_internal.c b/src/builtin/rs_vand/liberasurecode_rs_vand.c
index 2770908..90991b1 100644
--- a/src/builtin/rs_vand/rs_vand_internal.c
+++ b/src/builtin/rs_vand/liberasurecode_rs_vand.c
@@ -36,7 +36,7 @@
#include <string.h>
#include <stdint.h>
#include <rs_galois.h>
-#include <rs_vand_internal.h>
+#include <liberasurecode_rs_vand.h>
#include <unistd.h>
#include <fcntl.h>
@@ -132,12 +132,12 @@ int create_decoding_matrix(int *gen_matrix, int *dec_matrix, int *missing_idxs,
}
-void init_rs_vand(int k, int m)
+void init_liberasurecode_rs_vand(int k, int m)
{
rs_galois_init_tables();
}
-void deinit_rs_vand(int k, int m)
+void deinit_liberasurecode_rs_vand(int k, int m)
{
rs_galois_deinit_tables();
}
@@ -398,7 +398,7 @@ void region_dot_product(char **from_bufs, char *to_buf, int *matrix_row, int num
}
}
-int internal_rs_vand_encode(int *generator_matrix, char **data, char **parity, int k, int m, int blocksize)
+int liberasurecode_rs_vand_encode(int *generator_matrix, char **data, char **parity, int k, int m, int blocksize)
{
int i;
int n = k + m;
@@ -425,7 +425,7 @@ char **get_first_k_available(char **data, char **parity, int *missing, int k)
return first_k_available;
}
-int internal_rs_vand_decode(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int blocksize, int rebuild_parity)
+int liberasurecode_rs_vand_decode(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int blocksize, int rebuild_parity)
{
int *decoding_matrix = NULL;
int *inverse_decoding_matrix = NULL;
@@ -480,7 +480,7 @@ int internal_rs_vand_decode(int *generator_matrix, char **data, char **parity, i
return 0;
}
-int internal_rs_vand_reconstruct(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int destination_idx, int blocksize)
+int liberasurecode_rs_vand_reconstruct(int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int destination_idx, int blocksize)
{
int *decoding_matrix = NULL;
int *inverse_decoding_matrix = NULL;
diff --git a/src/erasurecode.c b/src/erasurecode.c
index 3c9e123..82874ea 100644
--- a/src/erasurecode.c
+++ b/src/erasurecode.c
@@ -44,7 +44,7 @@ extern struct ec_backend_common backend_jerasure_rs_vand;
extern struct ec_backend_common backend_jerasure_rs_cauchy;
extern struct ec_backend_common backend_isa_l_rs_vand;
extern struct ec_backend_common backend_shss;
-extern struct ec_backend_common backend_internal_rs_vand;
+extern struct ec_backend_common backend_liberasurecode_rs_vand;
ec_backend_t ec_backends_supported[] = {
(ec_backend_t) &backend_null,
@@ -53,7 +53,7 @@ ec_backend_t ec_backends_supported[] = {
(ec_backend_t) &backend_flat_xor_hd,
(ec_backend_t) &backend_isa_l_rs_vand,
(ec_backend_t) &backend_shss,
- (ec_backend_t) &backend_internal_rs_vand,
+ (ec_backend_t) &backend_liberasurecode_rs_vand,
NULL,
};
diff --git a/test/Makefile.am b/test/Makefile.am
index e45d400..d2449a5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,5 @@
noinst_HEADERS = builtin/xor_codes/test_xor_hd_code.h
-noinst_PROGRAMS = test_xor_hd_code alg_sig_test liberasurecode_test libec_slap rs_galois_test rs_vand_internal_test
+noinst_PROGRAMS = test_xor_hd_code alg_sig_test liberasurecode_test libec_slap rs_galois_test liberasurecode_rs_vand_test
test_xor_hd_code_SOURCES = \
builtin/xor_codes/test_xor_hd_code.c \
@@ -28,10 +28,10 @@ rs_galois_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_van
rs_galois_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la
check_PROGRAMS += rs_galois_test
-rs_vand_internal_test_SOURCES = builtin/rs_vand/rs_vand_internal_test.c
-rs_vand_internal_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_vand @GCOV_FLAGS@
-rs_vand_internal_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la
-check_PROGRAMS += rs_vand_internal_test
+liberasurecode_rs_vand_test_SOURCES = builtin/rs_vand/liberasurecode_rs_vand_test.c
+liberasurecode_rs_vand_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_vand @GCOV_FLAGS@
+liberasurecode_rs_vand_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la
+check_PROGRAMS += liberasurecode_rs_vand_test
MOSTLYCLEANFILES = *.gcda *.gcno *.gcov \
./builtin/xor_codes/*.gcda ./builtin/xor_codes/*.gcno ./builtin/xor_codes/*.gcov \
diff --git a/test/builtin/rs_vand/rs_vand_internal_test.c b/test/builtin/rs_vand/liberasurecode_rs_vand_test.c
index 09fc507..ae43ad9 100644
--- a/test/builtin/rs_vand/rs_vand_internal_test.c
+++ b/test/builtin/rs_vand/liberasurecode_rs_vand_test.c
@@ -30,7 +30,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
-#include <rs_vand_internal.h>
+#include <liberasurecode_rs_vand.h>
int test_make_systematic_matrix(int k, int m)
{
@@ -152,7 +152,7 @@ int test_encode_decode(int k, int m, int num_missing, int blocksize)
}
// Encode
- internal_rs_vand_encode(matrix, data, parity, k, m, blocksize);
+ liberasurecode_rs_vand_encode(matrix, data, parity, k, m, blocksize);
// Copy data and parity
for (i = 0;i < num_missing; i++) {
@@ -175,7 +175,7 @@ int test_encode_decode(int k, int m, int num_missing, int blocksize)
}
// Decode and check
- internal_rs_vand_decode(matrix, data, parity, k, m, missing, blocksize, 1);
+ liberasurecode_rs_vand_decode(matrix, data, parity, k, m, missing, blocksize, 1);
for (i = 0; i < num_missing; i++) {
int idx = missing[i];
@@ -235,7 +235,7 @@ int test_reconstruct(int k, int m, int num_missing, int blocksize)
}
// Encode
- internal_rs_vand_encode(matrix, data, parity, k, m, blocksize);
+ liberasurecode_rs_vand_encode(matrix, data, parity, k, m, blocksize);
// Copy data and parity
for (i = 0; i < num_missing; i++) {
@@ -261,7 +261,7 @@ int test_reconstruct(int k, int m, int num_missing, int blocksize)
}
// Reconstruct and check destination buffer
- internal_rs_vand_reconstruct(matrix, data, parity, k, m, missing, destination_idx, blocksize);
+ liberasurecode_rs_vand_reconstruct(matrix, data, parity, k, m, missing, destination_idx, blocksize);
// The original copy of the destination buffer is in the 0th buffer (see above)
if (destination_idx < k) {
@@ -302,7 +302,7 @@ int main()
while (matrix_dimensions[i][0] >= 0) {
int k = matrix_dimensions[i][0], m = matrix_dimensions[i][1];
- init_rs_vand(k, m);
+ init_liberasurecode_rs_vand(k, m);
int make_systematic_res = test_make_systematic_matrix(k, m);
if (!make_systematic_res) {
@@ -329,7 +329,7 @@ int main()
}
- deinit_rs_vand(k, m);
+ deinit_liberasurecode_rs_vand(k, m);
i++;
}
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
index 9f1ad9d..e4539cd 100644
--- a/test/liberasurecode_test.c
+++ b/test/liberasurecode_test.c
@@ -39,7 +39,7 @@
#define JERASURE_RS_CAUCHY_BACKEND "jerasure_rs_cauchy"
#define ISA_L_RS_VAND_BACKEND "isa_l_rs_vand"
#define SHSS_BACKEND "shss"
-#define RS_VAND_BACKEND "rs_vand"
+#define RS_VAND_BACKEND "liberasurecode_rs_vand"
typedef void (*TEST_FUNC)();
@@ -181,7 +181,7 @@ struct ec_args shss_args = {
struct ec_args *shss_test_args[] = { &shss_args, NULL };
-struct ec_args internal_rs_vand_args = {
+struct ec_args liberasurecode_rs_vand_args = {
.k = 10,
.m = 4,
.w = 16,
@@ -189,7 +189,7 @@ struct ec_args internal_rs_vand_args = {
.ct = CHKSUM_NONE,
};
-struct ec_args internal_rs_vand_44_args = {
+struct ec_args liberasurecode_rs_vand_44_args = {
.k = 4,
.m = 4,
.w = 16,
@@ -197,7 +197,7 @@ struct ec_args internal_rs_vand_44_args = {
.ct = CHKSUM_NONE,
};
-struct ec_args internal_rs_vand_48_args = {
+struct ec_args liberasurecode_rs_vand_48_args = {
.k = 4,
.m = 8,
.w = 16,
@@ -205,7 +205,7 @@ struct ec_args internal_rs_vand_48_args = {
.ct = CHKSUM_NONE,
};
-struct ec_args internal_rs_vand_1010_args = {
+struct ec_args liberasurecode_rs_vand_1010_args = {
.k = 10,
.m = 10,
.w = 16,
@@ -213,20 +213,22 @@ struct ec_args internal_rs_vand_1010_args = {
.ct = CHKSUM_NONE,
};
-struct ec_args *internal_rs_vand_test_args[] = { &internal_rs_vand_args,
- &internal_rs_vand_44_args,
- &internal_rs_vand_1010_args,
- &internal_rs_vand_48_args,
- NULL };
-
-struct ec_args **all_backend_tests[] = { null_test_args,
- flat_xor_test_args,
- jerasure_rs_vand_test_args,
- jerasure_rs_cauchy_test_args,
- isa_l_test_args,
- shss_test_args,
- internal_rs_vand_test_args,
- NULL};
+struct ec_args *liberasurecode_rs_vand_test_args[] = {
+ &liberasurecode_rs_vand_args,
+ &liberasurecode_rs_vand_44_args,
+ &liberasurecode_rs_vand_1010_args,
+ &liberasurecode_rs_vand_48_args,
+ NULL };
+
+struct ec_args **all_backend_tests[] = {
+ null_test_args,
+ flat_xor_test_args,
+ jerasure_rs_vand_test_args,
+ jerasure_rs_cauchy_test_args,
+ isa_l_test_args,
+ shss_test_args,
+ liberasurecode_rs_vand_test_args,
+ NULL};
int num_backends()
{
@@ -303,7 +305,7 @@ struct ec_args *create_ec_args(ec_backend_id_t be, ec_checksum_type_t ct, int ba
backend_args_array = jerasure_rs_cauchy_test_args;
break;
case EC_BACKEND_INTERNAL_RS_VAND:
- backend_args_array = internal_rs_vand_test_args;
+ backend_args_array = liberasurecode_rs_vand_test_args;
break;
case EC_BACKEND_FLAT_XOR_HD:
backend_args_array = flat_xor_test_args;
@@ -1833,39 +1835,39 @@ struct testcase testcases[] = {
test_create_and_destroy_backend,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"simple_encode_internal_rs_vand",
+ {"simple_encode_liberasurecode_rs_vand",
test_simple_encode_decode,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"decode_with_missing_data_internal_rs_vand",
+ {"decode_with_missing_data_liberasurecode_rs_vand",
test_decode_with_missing_data,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"decode_with_missing_multi_data_internal_rs_vand",
+ {"decode_with_missing_multi_data_liberasurecode_rs_vand",
test_decode_with_missing_multi_data,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"decode_with_missing_multi_parity_internal_rs_vand",
+ {"decode_with_missing_multi_parity_liberasurecode_rs_vand",
test_decode_with_missing_multi_parity,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"test_decode_with_missing_multi_data_parity_internal_rs_vand",
+ {"test_decode_with_missing_multi_data_parity_liberasurecode_rs_vand",
test_decode_with_missing_multi_data_parity,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"simple_reconstruct_internal_rs_vand",
+ {"simple_reconstruct_liberasurecode_rs_vand",
test_simple_reconstruct,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"test_fragments_needed_internal_rs_vand",
+ {"test_fragments_needed_liberasurecode_rs_vand",
test_fragments_needed,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"test_get_fragment_metadata_internal_rs_vand",
+ {"test_get_fragment_metadata_liberasurecode_rs_vand",
test_get_fragment_metadata,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE,
.skip = false},
- {"test_get_fragment_metadata_internal_rs_vand_crc32",
+ {"test_get_fragment_metadata_liberasurecode_rs_vand_crc32",
test_get_fragment_metadata,
EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_CRC32,
.skip = false},