]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Don't hand-code xor in ocfs2_hamming_encode().
authorJoel Becker <joel.becker@oracle.com>
Tue, 16 Dec 2008 01:13:48 +0000 (17:13 -0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:40:34 +0000 (08:40 -0800)
commit2384c0c1d3622aece263c905c543915c79aa7f47
tree1f9c19ba29f65e44c10d77597a746224e0e72c72
parent6734222f551e629eb73da555855e80c302cdcb16
ocfs2: Don't hand-code xor in ocfs2_hamming_encode().

When I wrote ocfs2_hamming_encode(), I was following documentation of
the algorithm and didn't have quite the (possibly still imperfect) grasp
of it I do now.  As part of this, I literally hand-coded xor.  I would
test a bit, and then add that bit via xor to the parity word.

I can, of course, just do a single xor of the parity word and the source
word (the code buffer bit offset).  This cuts CPU usage by 53% on a
mostly populated buffer (an inode containing utmp.h inline).

Joel

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