]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Another hamming code optimization.
authorJoel Becker <joel.becker@oracle.com>
Tue, 16 Dec 2008 02:24:33 +0000 (18:24 -0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:40:35 +0000 (08:40 -0800)
commitcf1294f33d783094a62970b80d338bbddb07b757
treea5d330c12f983837097f775e2d7c6c4d85fb9acd
parent2384c0c1d3622aece263c905c543915c79aa7f47
ocfs2: Another hamming code optimization.

In the calc_code_bit() function, we must find all powers of two beneath
the code bit number, *after* it's shifted by those powers of two.  This
requires a loop to see where it ends up.

We can optimize it by starting at its most significant bit.  This shaves
32% off the time, for a total of 67.6% shaved off of the original, naive
implementation.

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