Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 1/4] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree
Date: Thu, 16 May 2013 23:44:45 +0200	[thread overview]
Message-ID: <5195534D.5070505@giantdisaster.de> (raw)
In-Reply-To: <20130516161942.GA5187@twin.jikos.cz>

On 05/16/2013 18:19, David Sterba wrote:
> On Thu, May 16, 2013 at 04:45:55PM +0200, Stefan Behrens wrote:
>> +struct btrfs_uuid_item {
>> +	__le16 type;	/* refer to BTRFS_UUID_ITEM_TYPE* defines above */
>> +	__le32 len;	/* number of following 64bit values */
>> +	__le64 data[0];	/* data aligned to 64bit */
>> +} __attribute__ ((__packed__));
>
> With __packed__ (which is preferrably written as __packed) the data is
> not aligned to u64 as the comment says. Aligning u64's is a good thing,
> so (for example) pad the space after type (I don't think we need more
> than u16 here).

The on-disk format is in general not aligned (it is "packed") and stored 
on any byte-aligned position on the disk.

In the source code, you can use it for sizeof(), otherwise you use the 
access functions from ctree.h and struct-funcs.c.

I know that you know this already :) Maybe I am not understanding your 
review comment?

The "data" part in the btrfs_uuid_item (which represents the "value" of 
the (type, length, value) tripple) is a multiple of 64 bits, that's what 
I mean with the "data aligned to 64bit" comment.


  reply	other threads:[~2013-05-16 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 14:45 [PATCH v3 0/4] Btrfs-progs: speedup btrfs send/receive Stefan Behrens
2013-05-16 14:45 ` [PATCH v3 1/4] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree Stefan Behrens
2013-05-16 16:19   ` David Sterba
2013-05-16 21:44     ` Stefan Behrens [this message]
2013-05-16 14:45 ` [PATCH v3 2/4] Btrfs-progs: add UUID tree lookup methods Stefan Behrens
2013-05-16 14:45 ` [PATCH v3 3/4] Btrfs-progs: use UUID tree for send/receive Stefan Behrens
2013-05-16 14:45 ` [PATCH v3 4/4] Btrfs-progs: add uuid_tree_gen field to btrfs-show-super Stefan Behrens

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=5195534D.5070505@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox