All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Karsten Hopp <karsten@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Patch to support LUKS UUIDs in libblkid
Date: Tue, 12 Jun 2007 19:40:05 -0400	[thread overview]
Message-ID: <20070612234004.GA12189@thunk.org> (raw)
In-Reply-To: <466D373C.6000502@redhat.com>

On Mon, Jun 11, 2007 at 01:51:24PM +0200, Karsten Hopp wrote:
> +static int probe_luks(struct blkid_probe *probe,
> +		       struct blkid_magic *id __BLKID_ATTR((unused)), 
> +		       unsigned char *buf)
> +{
> +	unsigned char *p_buf = buf;
> +	unsigned char uuid[40];
> +	/* 168 is the offset to the 40 character uuid: 
> +	 * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
> +	p_buf += 168;
> +	strncpy(uuid, p_buf, 40);

Why bother with p_buf?  It would actually be shorter and sweeter to
do:

	strncpy(uuid, buf+168, 40);

And remove the lines dealing with p_buf above.

> +  { "crypt_LUKS",0,	 0,  6,	"LUKS\xba\xbe",		probe_luks },

Any particular reason to use "crypt_LUKS" instead of just "LUKS"?  In
your documentation you generally just refer to it as LUKS.

					- Ted

  reply	other threads:[~2007-06-13  2:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 11:23 Patch to support LUKS UUIDs in libblkid Karsten Hopp
2007-06-05 14:20 ` Eric Sandeen
2007-06-05 23:17 ` Andreas Dilger
2007-06-08 15:36 ` Theodore Tso
2007-06-11 11:51   ` Karsten Hopp
2007-06-12 23:40     ` Theodore Tso [this message]
2007-06-13 11:00       ` Karsten Hopp
2007-06-21 17:56         ` Theodore Tso
2007-07-03  9:19           ` Karsten Hopp
2007-07-03 15:57             ` Eric Sandeen
     [not found]           ` <46964694.7000707@redhat.com>
2007-07-23 15:00             ` Karsten Hopp
2007-07-23 16:19               ` Theodore Tso

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=20070612234004.GA12189@thunk.org \
    --to=tytso@mit.edu \
    --cc=karsten@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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.