Re: [PATCH 1/7] omfs: define filesystem structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 29 March 2008, Bob Copeland wrote:
> On Fri, Mar 28, 2008 at 09:19:40PM +0100, Pavel Machek wrote:
> > On Wed 2008-03-26 20:45:54, Bob Copeland wrote:
> > > +struct omfs_header {
> > > +   __be64 h_self;
> > > +   __be32 h_body_size;
> > > +   __be16 h_crc;
> > > +   char h_fill1[2];
> > > +   u8 h_version;
> > > +   char h_type;
> > > +   u8 h_magic;
> > > +   u8 h_check_xor;
> > > +   __be32 h_fill2;
> > > +};
> > 
> > attribute packed or something? Some strange machine (alpha?) may
> > decide to align u8s at 32bit boundaries...
> 
> Thanks, I guess this applies for all the on disk structs.

Actually, we don't normally add the attribute((packed)) in cases like
this one, where you already have manual padding in it. Marking this
structure packed would only cause a small performance loss on accesses
of its members on certain architectures, but not have an impact on
correctness.

No architecture supported by Linux requires higher than natural alignment
for any integer types, and a lot of other code would break otherwise.

	Arnd <><
--
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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux