From: Dave Chinner <david@fromorbit.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@redhat.com>,
Gordan Bobic <gordan@bobich.net>,
linux-ext4@vger.kernel.org
Subject: Re: e2fsprogs alignment issues
Date: Sat, 14 Jul 2012 08:25:31 +1000 [thread overview]
Message-ID: <20120713222531.GB2920@dastard> (raw)
In-Reply-To: <20120711200557.GB5838@thunk.org>
On Wed, Jul 11, 2012 at 04:05:57PM -0400, Theodore Ts'o wrote:
> I will *not* accept a patch which uses memcpy to copy each field in
> the on-disk superblock, or directory entry, into an int, just in case
> there is some insane architecture which requires that 4 byte integers
> be 32-byte aligned, or something else insane like that.
This is a problem we've had to deal with in the XFS userspace for
years because of the way extent records are packed into inodes.
Hence we have "get/set_unaligned_be32" and "get/set_unaligned_be64"
functions to read and write unaligned variables directly out of
buffers without having platform specific alignment issues. It's
exactly the same generic code as the kernel uses for this purpose.
See libxfs/xfs.h....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2012-07-13 22:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 13:20 e2fsprogs alignment issues Gordan Bobic
2012-07-11 15:04 ` Eric Sandeen
2012-07-11 20:05 ` Theodore Ts'o
2012-07-11 21:22 ` Gordan Bobic
2012-07-12 0:05 ` Theodore Ts'o
2012-07-11 21:26 ` Eric Sandeen
2012-07-13 22:25 ` Dave Chinner [this message]
2012-07-11 21:24 ` Gordan Bobic
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=20120713222531.GB2920@dastard \
--to=david@fromorbit.com \
--cc=gordan@bobich.net \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).