[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120713222531.GB2920@dastard>
Date: Sat, 14 Jul 2012 08:25:31 +1000
From: Dave Chinner <david@...morbit.com>
To: Theodore Ts'o <tytso@....edu>
Cc: Eric Sandeen <sandeen@...hat.com>,
Gordan Bobic <gordan@...ich.net>, linux-ext4@...r.kernel.org
Subject: Re: e2fsprogs alignment issues
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@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists