]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: One more hamming code optimization.
authorJoel Becker <joel.becker@oracle.com>
Tue, 16 Dec 2008 21:54:40 +0000 (13:54 -0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:40:35 +0000 (08:40 -0800)
commitd3e0264c20deb10250eb3d1bac73c33d21b431f1
treed598e01e07eb5a6a5c45ba45017b41f6d33eed54
parentcf1294f33d783094a62970b80d338bbddb07b757
ocfs2: One more hamming code optimization.

The previous optimization used a fast find-highest-bit-set operation to
give us a good starting point in calc_code_bit().  This version lets the
caller cache the previous code buffer bit offset.  Thus, the next call
always starts where the last one left off.

This reduces the calculation another 39%, for a total 80% reduction from
the original, naive implementation.  At least, on my machine.  This also
brings the parity calculation to within an order of magnitude of the
crc32 calculation.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/blockcheck.c