erasure-code: ensure that coding chunks are page aligned

When coding chunks are allocated for jerasure, their address must be
aligned to page boundaries. The requirement is actually to be aligned on
a long long boundary but bufferlist do not allow for fine tuning of the
alignment.

If padding is necessary because the total size of the data to be encoded
is not a multiple of the alignment requirements as returned by
get_alignment(), the buffer is not only padded but also rebuilt using
rebuild_page_aligned() to preserve the page alignment that is expected
of the input buffer.

The overhead of rebuilding the whole input buffer when padding is
necessary could be reduced by only reallocating one buffer for the last
data chunk, therefore reducing the amount of data being copied. However,
this optimization is not going to be used if the caller takes care of
the padding, which is likely to be the case most of the time.

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: relax zero copy requirements in tests

The input buffer is copied when padding is required. Remove the tests
that ensured the input buffer was not copied entirely when padding was
added.

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #1057 from dachary/wip-buffer-aligned

erasure-code: ensure that coding chunks are page aligned

Reviewed-by: Andreas Peters <andreas.joachim.peters@cern.ch>