]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: separate CRC calculation from byte swapping
authorAlex Elder <elder@dreamhost.com>
Wed, 15 Feb 2012 13:43:54 +0000 (07:43 -0600)
committerAlex Elder <elder@dreamhost.com>
Thu, 22 Mar 2012 15:47:51 +0000 (10:47 -0500)
commit1ad0d1f280c1f2cf689319b471dcfa4f77c77c22
tree6df7b2873d21f3c9c5e449aca1d8c16f4dd5fc1d
parent7dda6ae3c5a3b7e9048b2f1924ba768d011a955d
libceph: separate CRC calculation from byte swapping

Calculate CRC in a separate step from rearranging the byte order
of the result, to improve clarity and readability.

Use offsetof() to determine the number of bytes to include in the
CRC calculation.

In read_partial_message(), switch which value gets byte-swapped,
since the just-computed CRC is already likely to be in a register.

Signed-off-by: Alex Elder <elder@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
net/ceph/messenger.c