All of lore.kernel.org
 help / color / mirror / Atom feed
From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/misc/crc.c
Date: 8 Feb 2011 12:41:09 -0000	[thread overview]
Message-ID: <20110208124109.12853.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2011-02-08 12:41:08

Modified files:
	.              : WHATS_NEW 
	lib/misc       : crc.c 

Log message:
	Fix CRC32 calculation on big endian CPU
	
	Fix regresion from 2.02.75 speedup - so currently crc32 is a little bit
	more complicated on big-endian CPU as the uint32_t needs to be shifted
	on here.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1908&r2=1.1909
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/crc.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/WHATS_NEW	2011/02/04 22:46:18	1.1908
+++ LVM2/WHATS_NEW	2011/02/08 12:41:08	1.1909
@@ -1,5 +1,6 @@
 Version 2.02.84 - 
 ===================================
+  Fix CRC32 calculation on big endian CPU (2.02.75).
 
 Version 2.02.83 - 4th February 2011
 ===================================
--- LVM2/lib/misc/crc.c	2010/10/25 13:36:09	1.9
+++ LVM2/lib/misc/crc.c	2011/02/08 12:41:08	1.10
@@ -16,6 +16,7 @@
 #include "lib.h"
 
 #include "crc.h"
+#include "xlate.h"
 
 /* Calculate an endian-independent CRC of supplied buffer */
 #ifndef DEBUG_CRC32
@@ -65,7 +66,7 @@
    
 	/* Process 4 bytes per iteration */
 	while (start < end) {
-		crc = crc ^ *start++;
+		crc = crc ^ xlate32(*start++);
 		crc = crctab[crc & 0xff] ^ crc >> 8;
 		crc = crctab[crc & 0xff] ^ crc >> 8;
 		crc = crctab[crc & 0xff] ^ crc >> 8;



                 reply	other threads:[~2011-02-08 12:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110208124109.12853.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.