Subject: Re: file id alignment
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/01/2006 15:27:58
On Fri, Jun 30, 2006 at 07:44:17PM +0000, Christos Zoulas wrote:
> Index: fstypes.h
> ===================================================================
> RCS file: /cvsroot/src/sys/sys/fstypes.h,v
> retrieving revision 1.8
> diff -u -u -r1.8 fstypes.h
> --- fstypes.h 12 Feb 2006 01:32:07 -0000 1.8
> +++ fstypes.h 30 Jun 2006 19:42:52 -0000
> @@ -45,8 +45,13 @@
> struct fid {
> unsigned short fid_len; /* length of data in bytes */
> unsigned short fid_reserved; /* force longword alignment */
> - char fid_data[_VFS_MAXFIDSZ];/* data (variable length) */
> + union {
> + char _fid_data[_VFS_MAXFIDSZ];/* data (variable length) */
> + ino_t _fid_ino; /* for alignment */
> + } _fid_u;
> };
> +#define fid_data _fid_u._fid_data
> +
If 'struct fid' is being changed in an incompatible way, why not also
dispose of fid_reserved and make fid_len (say) unsigned int.
I presume that any padding between fid_len and fid_data is irrelevant.
David
--
David Laight: david@l8s.co.uk