Re: [PATCH 7/7] nfsd: nfs4xdr decode_stateid helper function

Trond Myklebust
2008-08-13T19:00:01Z

On Wed, 2008-08-13 at 14:30 -0400, J. Bruce Fields wrote:
> On Wed, Aug 13, 2008 at 01:59:09PM -0400, Trond Myklebust wrote:
> > Which is a good reason for ditching the entire confusing typedef, and
> > replacing it with a packed structure instead:
> >
> > struct stateid {
> > __be32 generation;
> > char opaque[12];
> > } __attribute__((packed));
>
> So without the ((packed)), all arrays get aligned to 8-byte boundaries
> on 64-bit machines? (What do I need to read to catch up here?)

A quick google showed up:

http://sig9.com/articles/gcc-packed-structures

In any case, yes, the idea behind the packed attribute is to turn off
the field alignment.

Cheers
Trond