Subject: Re: file id alignment
To: None <christos@astron.com>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 07/01/2006 19:45:23
> >I think we have a problem. We define the superclass of any file id as:
> >
> >Of course we could just tell FS authors to be carefull and copy byte by 
> >byte ;-)
> >
> >Any better suggestions? Comments?
> 
> How about changing VFS_MAXFIDSZ to 64 at the same time, so that
> we can construct NFS filehandles?
> 
> christos

if we are versioning getfh(2), let's make it free from this constant.

> @@ -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
> +

doesn't it make a compiler add some padding?

YAMAMOTO Takashi