On Mon, Feb 09, 2009 at 09:57:21AM +0300, Pavel Fedin wrote: > +struct fsBlockHeader { > + u32 id; /* 4 character id string of this block */ > + u32 checksum; /* The checksum */ > + u32 ownblock; /* The blocknumber of the block this > block is stored at */ > +}; This (and other) on-disc structs can be annotated so that automated tools like sparse can tell you if you've omitted an endian conversion somewhere. You can see examples of this in ext2: struct ext2_group_desc { __le32 bg_block_bitmap; /* Blocks bitmap block */ __le32 bg_inode_bitmap; /* Inodes bitmap block */ __le32 bg_inode_table; /* Inodes table block */ __le16 bg_free_blocks_count; /* Free blocks count */ __le16 bg_free_inodes_count; /* Free inodes count */ __le16 bg_used_dirs_count; /* Directories count */ __le16 bg_pad; __le32 bg_reserved[3]; }; Obviously, you'd want to use __be32 instead of __le32, but the principle is there. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html