All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: Bob Copeland <me@bobcopeland.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 6/7] omfs: add checksumming routines
Date: Thu, 27 Mar 2008 16:41:14 +0300	[thread overview]
Message-ID: <20080327164114.6c9fc82c.vsu@altlinux.ru> (raw)
In-Reply-To: <1206578760-9050-6-git-send-email-me@bobcopeland.com>

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

On Wed, 26 Mar 2008 20:45:59 -0400 Bob Copeland wrote:

> OMFS checksums the metadata of all filesystem objects.  This change adds
> the necessary functions to do so.
>
> Signed-off-by: Bob Copeland <me@bobcopeland.com>
> ---
>  fs/omfs/checksum.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 48 insertions(+), 0 deletions(-)
>  create mode 100644 fs/omfs/checksum.c
>
> diff --git a/fs/omfs/checksum.c b/fs/omfs/checksum.c
> new file mode 100644
> index 0000000..d6f1023
> --- /dev/null
> +++ b/fs/omfs/checksum.c
> @@ -0,0 +1,48 @@
> +#include <linux/fs.h>
> +#include <linux/buffer_head.h>
> +#include "omfs.h"
> +
> +#define POLY 0x1021
> +
> +/*
> + * crc-ccitt with MSB first (i.e., backwards), so we can't use the
> + * kernel table as-is.
> + */
> +static u16 omfs_crc(u16 crc, unsigned char *buf, int count)
> +{
> +	int i, j;
> +	for (i = 0; i < count; i++) {
> +		crc ^= buf[i] << 8;
> +		for (j = 0; j < 8; j++)
> +			crc = (crc << 1) ^ ((crc & 0x8000) ? POLY : 0);
> +	}
> +	return crc;
> +}

Is this the same as crc_itu_t() from lib/crc-itu-t.c (also duplicated
in fs/udf/crc.c)?

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2008-03-27 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27  0:45 [PATCH 6/7] omfs: add checksumming routines Bob Copeland
2008-03-27  1:22 ` Harvey Harrison
2008-03-27 12:24   ` Bob Copeland
2008-03-27 13:41 ` Sergey Vlasov [this message]
2008-03-27 14:34   ` Bob Copeland
2008-03-30  3:30   ` Bob Copeland
  -- strict thread matches above, loose matches on Subject: below --
2008-04-12 22:58 Bob Copeland
2008-04-13  8:09 ` Christoph Hellwig

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=20080327164114.6c9fc82c.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@bobcopeland.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.