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.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to