diff options
-rw-r--r-- | src/osd/ErasureCodePluginJerasure/Makefile.am | 19 | ||||
-rwxr-xr-x | src/osd/ErasureCodePluginJerasure/galois.c | 12 | ||||
-rwxr-xr-x | src/osd/ErasureCodePluginJerasure/jerasure.c | 18 | ||||
-rwxr-xr-x | src/osd/ErasureCodePluginJerasure/reed_sol.c | 3 | ||||
-rw-r--r-- | src/osd/Makefile.am | 2 |
5 files changed, 33 insertions, 21 deletions
diff --git a/src/osd/ErasureCodePluginJerasure/Makefile.am b/src/osd/ErasureCodePluginJerasure/Makefile.am new file mode 100644 index 00000000000..e599bb811b1 --- /dev/null +++ b/src/osd/ErasureCodePluginJerasure/Makefile.am @@ -0,0 +1,19 @@ +# jerasure plugin +libec_jerasure_la_SOURCES = \ + osd/ErasureCodePluginJerasure/cauchy.c \ + osd/ErasureCodePluginJerasure/galois.c \ + osd/ErasureCodePluginJerasure/jerasure.c \ + osd/ErasureCodePluginJerasure/liberation.c \ + osd/ErasureCodePluginJerasure/reed_sol.c +noinst_HEADERS += \ + osd/ErasureCodePluginJerasure/cauchy.h \ + osd/ErasureCodePluginJerasure/galois.h \ + osd/ErasureCodePluginJerasure/jerasure.h \ + osd/ErasureCodePluginJerasure/liberation.h \ + osd/ErasureCodePluginJerasure/reed_sol.h +libec_jerasure_la_CFLAGS = ${AM_CFLAGS} +libec_jerasure_la_CXXFLAGS= ${AM_CXXFLAGS} +libec_jerasure_la_LIBADD = $(PTHREAD_LIBS) $(EXTRALIBS) +libec_jerasure_la_LDFLAGS = ${AM_LDFLAGS} -version-info 1:0:0 + +erasure_codelib_LTLIBRARIES += libec_jerasure.la diff --git a/src/osd/ErasureCodePluginJerasure/galois.c b/src/osd/ErasureCodePluginJerasure/galois.c index a29a417a343..be8be59affa 100755 --- a/src/osd/ErasureCodePluginJerasure/galois.c +++ b/src/osd/ErasureCodePluginJerasure/galois.c @@ -563,7 +563,7 @@ void galois_w16_region_multiply(char *region, /* Region to multiply */ void galois_invert_binary_matrix(int *mat, int *inv, int rows) { - int cols, i, j, k; + int cols, i, j; int tmp; cols = rows; @@ -618,9 +618,9 @@ int galois_inverse(int y, int w) int galois_shift_inverse(int y, int w) { - int mat[1024], mat2[32]; - int inv[1024], inv2[32]; - int ind, i, j, k, prod; + int mat2[32]; + int inv2[32]; + int i; for (i = 0; i < w; i++) { mat2[i] = y; @@ -684,15 +684,13 @@ void galois_w32_region_multiply(char *region, /* Region to multiply */ char *r2, /* If r2 != NULL, products go here */ int add) { - unsigned int *ur1, *ur2, *cp, *ur2top; - unsigned long *lp2, *lptop; + unsigned int *ur1, *ur2; int i, j, a, b, accumulator, i8, j8, k; int acache[4]; ur1 = (unsigned int *) region; ur2 = (r2 == NULL) ? ur1 : (unsigned int *) r2; nbytes /= sizeof(int); - ur2top = ur2 + nbytes; if (galois_split_w8[0]== NULL) { if (galois_create_split_w8_tables(8) < 0) { diff --git a/src/osd/ErasureCodePluginJerasure/jerasure.c b/src/osd/ErasureCodePluginJerasure/jerasure.c index 802873a4070..831ae2409a4 100755 --- a/src/osd/ErasureCodePluginJerasure/jerasure.c +++ b/src/osd/ErasureCodePluginJerasure/jerasure.c @@ -169,7 +169,7 @@ int jerasure_make_decoding_bitmatrix(int k, int m, int w, int *matrix, int *eras int jerasure_matrix_decode(int k, int m, int w, int *matrix, int row_k_ones, int *erasures, char **data_ptrs, char **coding_ptrs, int size) { - int i, j, edd, lastdrive; + int i, edd, lastdrive; int *tmpids; int *erased, *decoding_matrix, *dm_ids; @@ -301,8 +301,7 @@ int *jerasure_matrix_to_bitmatrix(int k, int m, int w, int *matrix) void jerasure_matrix_encode(int k, int m, int w, int *matrix, char **data_ptrs, char **coding_ptrs, int size) { - int *init; - int i, j; + int i; if (w != 8 && w != 16 && w != 32) { fprintf(stderr, "ERROR: jerasure_matrix_encode() and w is not 8, 16 or 32\n"); @@ -639,7 +638,7 @@ void jerasure_matrix_dotprod(int k, int w, int *matrix_row, int jerasure_bitmatrix_decode(int k, int m, int w, int *bitmatrix, int row_k_ones, int *erasures, char **data_ptrs, char **coding_ptrs, int size, int packetsize) { - int i, j; + int i; int *erased; int *decoding_matrix; int *dm_ids; @@ -777,7 +776,6 @@ static int set_up_ids_for_scheduled_decoding(int k, int m, int *erasures, int *r { int ddf, cdf; int *erased; - char **ptrs; int i, j, x; ddf = 0; @@ -1012,9 +1010,6 @@ int jerasure_schedule_decode_cache(int k, int m, int w, int ***scache, int *eras int ***jerasure_generate_schedule_cache(int k, int m, int w, int *bitmatrix, int smart) { - int i, tdone; - char **ptrs; - int **schedule; int ***scache; int erasures[3]; int e1, e2; @@ -1141,7 +1136,7 @@ int jerasure_invertible_bitmatrix(int *mat, int rows) int *jerasure_matrix_multiply(int *m1, int *m2, int r1, int c1, int r2, int c2, int w) { - int *product, i, j, k, l; + int *product, i, j, k; product = (int *) malloc(sizeof(int)*r1*c2); for (i = 0; i < r1*c2; i++) product[i] = 0; @@ -1195,7 +1190,7 @@ void jerasure_schedule_encode(int k, int m, int w, int **schedule, char **data_ptrs, char **coding_ptrs, int size, int packetsize) { char **ptr_copy; - int i, j, tdone; + int i, tdone; ptr_copy = talloc(char *, (k+m)); for (i = 0; i < k; i++) ptr_copy[i] = data_ptrs[i]; @@ -1362,8 +1357,7 @@ int **jerasure_smart_bitmatrix_to_schedule(int k, int m, int w, int *bitmatrix) void jerasure_bitmatrix_encode(int k, int m, int w, int *bitmatrix, char **data_ptrs, char **coding_ptrs, int size, int packetsize) { - int i, j, x, y, sptr, pstarted, index; - char *dptr, *pptr; + int i; if (packetsize%sizeof(long) != 0) { fprintf(stderr, "jerasure_bitmatrix_encode - packetsize(%d) %c sizeof(long) != 0\n", packetsize, '%'); diff --git a/src/osd/ErasureCodePluginJerasure/reed_sol.c b/src/osd/ErasureCodePluginJerasure/reed_sol.c index 596882af01f..003eb419ad0 100755 --- a/src/osd/ErasureCodePluginJerasure/reed_sol.c +++ b/src/osd/ErasureCodePluginJerasure/reed_sol.c @@ -78,8 +78,7 @@ int *reed_sol_r6_coding_matrix(int k, int w) int *reed_sol_vandermonde_coding_matrix(int k, int m, int w) { - int tmp; - int i, j, index; + int i, j; int *vdm, *dist; vdm = reed_sol_big_vandermonde_distribution_matrix(k+m, k, w); diff --git a/src/osd/Makefile.am b/src/osd/Makefile.am index a6ab39275aa..ea7c036f858 100644 --- a/src/osd/Makefile.am +++ b/src/osd/Makefile.am @@ -2,6 +2,8 @@ erasure_codelibdir = $(libdir)/erasure-code erasure_codelib_LTLIBRARIES = +include osd/ErasureCodePluginJerasure/Makefile.am + libosd_la_SOURCES = \ osd/ErasureCodePlugin.cc \ osd/PG.cc \ |