From: Matthew Wilcox <matthew@wil.cx>
To: Pavel Fedin <sonic.amiga@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 9/9] Amiga SmartFileSystem
Date: Mon, 9 Feb 2009 02:22:08 -0700 [thread overview]
Message-ID: <20090209092208.GN31509@parisc-linux.org> (raw)
In-Reply-To: <187c6cc60902082257s4abd8598o973306a16d59e4f7@mail.gmail.com>
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."
next prev parent reply other threads:[~2009-02-09 9:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-09 6:57 [PATCH 9/9] Amiga SmartFileSystem Pavel Fedin
2009-02-09 9:22 ` Matthew Wilcox [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-12-26 12:07 Pavel Fedin
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=20090209092208.GN31509@parisc-linux.org \
--to=matthew@wil.cx \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sonic.amiga@gmail.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.