Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / erasure-code / jerasure / jerasure_init.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph distributed storage system
5  *
6  * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
7  * Copyright (C) 2014 Red Hat <contact@redhat.com>
8  *
9  * Author: Loic Dachary <loic@dachary.org>
10  *
11  *  This library is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU Lesser General Public
13  *  License as published by the Free Software Foundation; either
14  *  version 2.1 of the License, or (at your option) any later version.
15  * 
16  */
17
18 #include "common/debug.h"
19 #include "jerasure_init.h"
20
21 extern "C" {
22 #include "galois.h"
23 }
24
25 #define dout_context g_ceph_context
26
27 extern "C" int jerasure_init(int count, int *words)
28 {
29   for(int i = 0; i < count; i++) {
30     int r = galois_init_default_field(words[i]);
31     if (r) {
32       derr << "failed to galois_init_default_field(" << words[i] << ")" << dendl;
33       return -r;
34     }
35   }
36   return 0;
37 }