]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ErasureCodeJerasure: fix jerasure compilation
authorLoic Dachary <loic@dachary.org>
Fri, 23 Aug 2013 20:41:37 +0000 (22:41 +0200)
committerLoic Dachary <loic@dachary.org>
Tue, 10 Sep 2013 00:01:21 +0000 (02:01 +0200)
Add the imported jerasure-1.2A to the Makefile.am and fix the
compilation warnings.

https://github.com/dachary/ceph/tree/wip-5879 refs #5879

Signed-off-by: Loic Dachary <loic@dachary.org>
src/osd/ErasureCodePluginJerasure/Makefile.am [new file with mode: 0644]
src/osd/ErasureCodePluginJerasure/galois.c
src/osd/ErasureCodePluginJerasure/jerasure.c
src/osd/ErasureCodePluginJerasure/reed_sol.c
src/osd/Makefile.am

diff --git a/src/osd/ErasureCodePluginJerasure/Makefile.am b/src/osd/ErasureCodePluginJerasure/Makefile.am
new file mode 100644 (file)
index 0000000..e599bb8
--- /dev/null
@@ -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
index a29a417a343239e66183aed73dd58a03c64b729b..be8be59affa0cfaa04846250b1a23fb0564e1888 100755 (executable)
@@ -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) {
index 802873a4070bf524151427894e18517f5dd088d9..831ae2409a4d250c8f1fe91111ebed3509a97286 100755 (executable)
@@ -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, '%');
index 596882af01f8ff61929dda5eb69f11c7ebb55faa..003eb419ad0d67a53dcadcfd0dc3cb6f66385348 100755 (executable)
@@ -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);
index a6ab39275aa9ec3a8ca58cab54d5a887b9cce568..ea7c036f858037d4783f62e447dfd2e3759e5c66 100644 (file)
@@ -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 \