xfs
[Top] [All Lists]

Re: [PATCH 05/13] xfs: add CRC infrastructure

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 05/13] xfs: add CRC infrastructure
From: "Josef 'Jeff' Sipek" <jeffpc@xxxxxxxxxxxxxx>
Date: Thu, 12 Feb 2009 01:10:13 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20090210202939.667316000@xxxxxxxxxxxxxxxxxxxxxx>
References: <20090210202241.546501000@xxxxxxxxxxxxxxxxxxxxxx> <20090210202939.667316000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Feb 10, 2009 at 03:22:46PM -0500, Christoph Hellwig wrote:
...
> Index: xfs/fs/xfs/xfs_cksum.h
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ xfs/fs/xfs/xfs_cksum.h    2009-02-05 19:04:31.282972630 +0100
> @@ -0,0 +1,62 @@
> +#ifndef _XFS_CKSUM_H
> +#define _XFS_CKSUM_H 1
> +
> +#define XFS_CRC_SEED (~(__uint32_t)0)

Is this the final seed you want to use, or was this just a
work-in-progress-non-zero value for testing?

...
> +/*
> + * Convert the intermediate checksum to the final ondisk format.
> + *
> + * Note that crc32c is already endianess agnostic, so no additional
> + * byte swap is needed.
> + */
> +static inline __be32
> +xfs_end_cksum(__uint32_t crc)
> +{
> +     return (__force __be32)~crc;
> +}

Why the bit-wise not?

Josef 'Jeff' Sipek.

-- 
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
                - Brian W. Kernighan 

<Prev in Thread] Current Thread [Next in Thread>