]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: ensure that coding chunks are page aligned
authorLoic Dachary <loic@dachary.org>
Wed, 8 Jan 2014 19:13:37 +0000 (20:13 +0100)
committerLoic Dachary <loic@dachary.org>
Wed, 8 Jan 2014 19:13:37 +0000 (20:13 +0100)
commit656de1b668a4148a19b0bbc2b941415790ee0343
treedd5354747d4ed26d0fd84ca47c54131e16552e14
parentb6adf5970819d1487cfdd8c80047f83908666954
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>
src/osd/ErasureCodePluginJerasure/ErasureCodeJerasure.cc