The raid6 code matches kernel implementation that also does the
unaligned access. So to keep the code close, add helpers for unaligned
native access and use them. The helpers are local as we don't plan to
use them elsewhere.
Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
raid6.c is built without access to the prototypes of functions it
exports.
warning: symbol 'raid6_gen_syndrome' was not declared. Should it be static?
They could be changed and get out of sync of the exported prototypes
without errors. So we add disk-io.h, and its dependency ctree.h, so
that it has a chance to check that its exported prototypes are correct.
Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
raid6.c was failing to build for Goffredo and me due to
__attribute_const__ being undefined.
Define it in kerncompat.h and include that; this also makes
sure BITS_PER_LONG is defined for raid6.c, prior to this it
was not defined, at least in my build.
Finally, redefine BITS_PER_LONG in a way that it can be
tested in the preprocessor macro.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
David Woodhouse originally contributed this code, and Chris Mason
changed it around to reflect the current design goals for raid56.
The original code expected all metadata and data writes to be full
stripes. This meant metadata block size == stripe size, and had a few
other restrictions.
This version allows metadata blocks smaller than the stripe size. It
implements both raid5 and raid6, although it does not have code to
rebuild from parity if one of the drives is missing or incorrect.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>