Subject: Re: file id alignment
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 06/30/2006 19:44:17
In article <20060629215104.GC16200@drowsy.duskware.de>,
Martin Husemann  <martin@duskware.de> wrote:
>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

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 defined(_NETBSD_SOURCE)
 #define	VFS_MAXFIDSZ	_VFS_MAXFIDSZ