Commit Graph

13 Commits

Author SHA1 Message Date
Pete Zaitcev 960cdd09dc Stop using ceill() to compute padded data size
The well-known idiom to compute a required number of data blocks
of size B to contain data of length d is:

     (d + (B-1))/B

The code we use, with ceill(), computes the same value, but does
it in an unorthodox way. This makes a reviewer to doubt himself
and even run tests to make sure we're really computing the
obvious thing.

Apropos the reviewer confusion, the code in Phazr.IO looks weird.
It uses (word_size - hamming_distance) to compute the necessary
number of blocks... but then returns the amount of memory needed
to store blocks of a different size (word_size). We left all of it
alone and return exactly the same values that the old computation
returned.

All these computations were the only thing in the code that used
-lm, so drop that too.

Coincidentially, this patch solves the crash of distro-built
packages of liberasurecode (see Red Hat bug #1454543). But it's
a side effect. Expect a proper patch soon.

Change-Id: Ib297f6df304abf5ca8c27d3392b1107a525e0be0
2017-06-06 14:53:45 -04:00
Tushar Gohad dc11fba685 Eliminate erasurecode_stdinc.h dependency on log.h 2015-09-18 16:42:43 +00:00
Eric Lambert 2798a65d81 Make include of config_liberasurecode.h conditonal. Have been expermenting with using cmake to build the project and cmake does not generate the config_liberasurecode.h file. 2014-11-08 08:31:34 -08:00
Eric Lambert 62fba6ba49 add backend_id and backend_version to fragment metadata 2014-10-03 17:08:05 -07:00
Kevin Greenan 4469d69a1e Distributing the generated config.h (renamed to config_erasurecode.h), since it is used by the publid headers... 2014-07-31 08:32:32 -07:00
Tushar Gohad 94c0253253 gf: Convert exit(1)s to return statements
... shared library should not call exit()

Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-21 09:36:33 -07:00
Tushar Gohad 33dce84728 Add syslog based logging routines
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-18 04:42:38 -07:00
Tushar Gohad e92d3de70d Add helper prototypes to erasurecode_helpers.h
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-17 15:35:45 -07:00
Tushar Gohad dee9ece2f7 Add get_aligned_data_size() to ec helpers
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-17 15:29:33 -07:00
Tushar Gohad 6533759ba5 Frontend/backend API split, make EC handle int type
.. also introduce a map for backend method stub name
to backend library function names

Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-13 19:26:23 -07:00
Tushar Gohad 06e221f670 autoheader: Additional headers in liberasurecode_stdinc.h
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-07 22:16:33 -07:00
Tushar Gohad 9359459145 api: Fix unterminated endif in Mac OS X section
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-06-29 21:42:09 -07:00
Tushar Gohad 4edd696f0a Add list.h, use include/<dir> for erasurecode hdrs
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-06-29 20:05:24 -07:00