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)
commit7bb458a58588f397068e4166c615e9fcc7480c16
treea5d330c12f983837097f775e2d7c6c4d85fb9acd
parente798b3f8a920c82a8e556dd54df97f0d3d0f9144
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