Coda File System

64bit SPARC kernel fixes...

From: Roland Mainz <Roland.Mainz_at_informatik.med.uni-giessen.de>
Date: Tue, 10 Oct 2000 16:34:11 +0200
Hi !

----

Again... more kernel module&&header fixes for 64bit Solaris SPARC.
I've attched a "diff -r -c -w" from original solaris-coda-0.03 to my
solaris-coda-0.04 branch (solaris-coda-0.04-64bitfix.diff) and a "new"
coda.h (difference from previously posted version is that I forgot to
fix cdev_t (which is equal to dev_t in Solaris - unfortunately dev_t is
32bit on 32bit kernels and 64bit on 64bit kernels).
The userspace part (venus or podfuk) now works properly with both 32bit
and 64bit kernel modules.
Makefile has been adapted to "automagically" build the correct version
for the platform+kernel on which it is running on (unfortunately 64bit
required Sun Workshop 5/6 compiler).

Can anyone verify that this works outside of my system ?
Comments ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) Roland.Mainz_at_informatik.med.uni-giessen.de
  \__\/\/__/  gisburn_at_informatik.med.uni-giessen.de
  /O /==\ O\  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
 (;O/ \/ \O;) TEL +49 641 99-13193 FAX +49 641 99-41359
Common subdirectories: solaris-coda-0.03/CVS and solaris-coda-0.03_gisburn/CVS
diff -r -c -w solaris-coda-0.03/Makefile solaris-coda-0.03_gisburn/Makefile
*** solaris-coda-0.03/Makefile	Fri Feb  4 18:36:55 2000
--- solaris-coda-0.03_gisburn/Makefile	Wed Oct  4 13:05:27 2000
***************
*** 2,10 ****
  
  SHELL=/bin/sh
  CPU=$(shell uname -m)
  
  all: obj.$(CPU)/Makefile
! 	(cd obj.$(CPU); $(MAKE))
  
  obj.$(CPU)/Makefile: obj.$(CPU) src/Makefile.in
  	cp src/Makefile.in obj.$(CPU)/Makefile
--- 2,12 ----
  
  SHELL=/bin/sh
  CPU=$(shell uname -m)
+ KERNEL_PREFIX=$(shell if [ `isainfo -k` = sparcv9 ] ; then echo "/sparcv9" ;fi)
+ XARCH=$(shell if [ `isainfo -k` = sparcv9 ] ; then echo "-xarch=v9" ; else echo "-xarch=v7" ; fi)
  
  all: obj.$(CPU)/Makefile
! 	(cd obj.$(CPU); $(MAKE) XARCH=${XARCH})
  
  obj.$(CPU)/Makefile: obj.$(CPU) src/Makefile.in
  	cp src/Makefile.in obj.$(CPU)/Makefile
***************
*** 25,33 ****
  	-rem_drv coda
  	-rm -f /dev/cfs0
  	ln -s /devices/pseudo/coda_at_0:coda /dev/cfs0
! 	cp obj.$(CPU)/coda /usr/kernel/drv
  	echo 'name="coda" parent="pseudo" instance=0;' > /usr/kernel/drv/coda.conf
! 	chmod 644 /usr/kernel/drv/coda /usr/kernel/drv/coda.conf
  	add_drv coda
  
  clean:
--- 27,37 ----
  	-rem_drv coda
  	-rm -f /dev/cfs0
  	ln -s /devices/pseudo/coda_at_0:coda /dev/cfs0
! 	cp obj.$(CPU)/coda /usr/kernel/drv$(KERNEL_PREFIX)
  	echo 'name="coda" parent="pseudo" instance=0;' >/usr/kernel/drv/coda.conf
! 	chmod 644 /usr/kernel/drv$(KERNEL_PREFIX)/coda /usr/kernel/drv/coda.conf
! 	chmod a+rx /usr/kernel/drv$(KERNEL_PREFIX)/coda
! 	chown root:sys /usr/kernel/drv$(KERNEL_PREFIX)/coda
  	add_drv coda
  
  clean:
Only in solaris-coda-0.03_gisburn: Makefile.original
Common subdirectories: solaris-coda-0.03/include and solaris-coda-0.03_gisburn/include
Only in solaris-coda-0.03_gisburn: obj.sun4m
Only in solaris-coda-0.03_gisburn: obj.sun4u
Common subdirectories: solaris-coda-0.03/sol-include and solaris-coda-0.03_gisburn/sol-include
Common subdirectories: solaris-coda-0.03/src and solaris-coda-0.03_gisburn/src
Common subdirectories: solaris-coda-0.03/include/CVS and solaris-coda-0.03_gisburn/include/CVS
diff -r -c -w solaris-coda-0.03/include/coda.h solaris-coda-0.03_gisburn/include/coda.h
*** solaris-coda-0.03/include/coda.h	Fri Feb  4 18:36:58 2000
--- solaris-coda-0.03_gisburn/include/coda.h	Mon Oct  9 16:47:48 2000
***************
*** 8,14 ****
                             Coda File System
                                Release 5
  
!           Copyright (c) 1987-1999 Carnegie Mellon University
                    Additional copyrights listed below
  
  This code is distributed "AS IS" without warranty of any kind under
--- 8,14 ----
                             Coda File System
                                Release 5
  
!           Copyright (c) 1987-2000 Carnegie Mellon University
                    Additional copyrights listed below
  
  This code is distributed "AS IS" without warranty of any kind under
***************
*** 25,31 ****
              Coda: an Experimental Distributed File System
                               Release 4.0
  
!           Copyright (c) 1987-1999 Carnegie Mellon University
                           All Rights Reserved
  
  Permission  to  use, copy, modify and distribute this software and its
--- 25,31 ----
              Coda: an Experimental Distributed File System
                               Release 4.0
  
!           Copyright (c) 1987-2000 Carnegie Mellon University
                           All Rights Reserved
  
  Permission  to  use, copy, modify and distribute this software and its
***************
*** 54,59 ****
--- 54,61 ----
   * Based on cfs.h from Mach, but revamped for increased simplicity.
   * Linux modifications by 
   * Peter Braam, Aug 1996
+  *
+  * Solaris 64bit fixes by Roland Mainz <Roland.Mainz_at_informatik.med.uni-giessen.de>
   */
  
  #ifndef _CODA_HEADER_
***************
*** 109,119 ****
  typedef unsigned long long u_quad_t;
  #endif /* __KERNEL__ */
  #else
! #define cdev_t dev_t
  #endif
  
  /* Solaris Definitions */
! #if defined(sun)
  #include <sys/types.h>
  #include <sys/time.h>
  #define __BIT_TYPES_DEFINED__
--- 111,127 ----
  typedef unsigned long long u_quad_t;
  #endif /* __KERNEL__ */
  #else
! #ifdef __sun
! /* warning: Solaris 64bit uses 64bit for dev_t, 32bit uses 32bit. To maintain binary 
!  * compatibility between 32bit and 64bit kernel modules padding is required */
! typedef unsigned long long cdev_t; 
! #else 
! typedef dev_t cdev_t
! #endif /* __sun */
  #endif
  
  /* Solaris Definitions */
! #ifdef __sun
  #include <sys/types.h>
  #include <sys/time.h>
  #define __BIT_TYPES_DEFINED__
***************
*** 120,126 ****
--- 128,137 ----
  typedef unsigned char      u_int8_t;
  typedef unsigned short     u_int16_t;
  typedef unsigned int       u_int32_t;
+ typedef unsigned long long u_int64_t;
  typedef unsigned long long u_quad_t;
+ 
+ #define inline
  #endif
  
  #ifdef __CYGWIN32__
***************
*** 130,135 ****
--- 141,155 ----
  };
  #endif
  
+ #ifndef __sun
+ /* for all platforms except 64bit sparc:
+  * for all non-64bit platforms timespec == timespec32
+  * timespec32 is a "special" timespec datatype which 
+  * is used for 64bit compatibility
+  */
+ typedef timespec timespec32
+ #endif
+ 
  #ifndef __BIT_TYPES_DEFINED__
  #define __BIT_TYPES_DEFINED__
  typedef signed char	      int8_t;
***************
*** 168,179 ****
  #define C_A_X_OK    1               /* Test for execute permission.  */
  #define C_A_F_OK    0               /* Test for existence.  */
  
! #if defined(sun)
  #define _VENUS_DIRENT_T_ 1
  struct venus_dirent {
!         unsigned long	d_fileno;		/* file number of entry */
!         unsigned short	d_reclen;		/* length of this record */
!         unsigned short	d_namlen;		/* length of string in d_name */
          char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
  };
  #undef DIRSIZ
--- 188,199 ----
  #define C_A_X_OK    1               /* Test for execute permission.  */
  #define C_A_F_OK    0               /* Test for existence.  */
  
! #ifdef __sun
  #define _VENUS_DIRENT_T_ 1
  struct venus_dirent {
!         u_int32_t	d_fileno;		/* file number of entry */
!         u_int16_t	d_reclen;		/* length of this record */
!         u_int16_t	d_namlen;		/* length of string in d_name */
          char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
  };
  #undef DIRSIZ
***************
*** 184,193 ****
  #ifndef _VENUS_DIRENT_T_
  #define _VENUS_DIRENT_T_ 1
  struct venus_dirent {
!         unsigned long	d_fileno;		/* file number of entry */
!         unsigned short	d_reclen;		/* length of this record */
!         unsigned char 	d_type;			/* file type, see below */
!         unsigned char	d_namlen;		/* length of string in d_name */
          char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
  };
  #undef DIRSIZ
--- 204,213 ----
  #ifndef _VENUS_DIRENT_T_
  #define _VENUS_DIRENT_T_ 1
  struct venus_dirent {
!         u_int32_t       d_fileno;		/* file number of entry */
!         u_int16_t	d_reclen;		/* length of this record */
!         u_int8_t 	d_type;			/* file type, see below */
!         u_int8_t	d_namlen;		/* length of string in d_name */
          char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
  };
  #undef DIRSIZ
***************
*** 217,226 ****
  
  #ifndef	_FID_T_
  #define _FID_T_	1
! typedef u_long VolumeId;
! typedef u_long VnodeId;
! typedef u_long Unique_t;
! typedef u_long FileVersion;
  #endif 
  
  #ifndef	_VICEFID_T_
--- 237,246 ----
  
  #ifndef	_FID_T_
  #define _FID_T_	1
! typedef u_int32_t VolumeId;
! typedef u_int32_t VnodeId;
! typedef u_int32_t Unique_t;
! typedef u_int32_t FileVersion;
  #endif 
  
  #ifndef	_VICEFID_T_
***************
*** 272,293 ****
  enum coda_vtype	{ C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
  
  struct coda_vattr {
! 	long     	va_type;	/* vnode type (for create) */
! 	u_short		va_mode;	/* files access mode and type */
! 	short		va_nlink;	/* number of references to file */
  	vuid_t		va_uid;		/* owner user id */
  	vgid_t		va_gid;		/* owner group id */
! 	long		va_fileid;	/* file id */
! 	u_quad_t	va_size;	/* file size in bytes */
! 	long		va_blocksize;	/* blocksize preferred for i/o */
! 	struct timespec	va_atime;	/* time of last access */
! 	struct timespec	va_mtime;	/* time of last modification */
! 	struct timespec	va_ctime;	/* time file changed */
! 	u_long		va_gen;		/* generation number of file */
! 	u_long		va_flags;	/* flags defined for file */
  	cdev_t	        va_rdev;	/* device special file represents */
! 	u_quad_t	va_bytes;	/* bytes of disk space held by file */
! 	u_quad_t	va_filerev;	/* file modification number */
  };
  
  #endif 
--- 292,313 ----
  enum coda_vtype	{ C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
  
  struct coda_vattr {
! 	int32_t     		va_type;	/* vnode type (for create) */
! 	u_int16_t		va_mode;	/* files access mode and type */
! 	int16_t			va_nlink;	/* number of references to file */
  	vuid_t			va_uid;		/* owner user id */
  	vgid_t			va_gid;		/* owner group id */
! 	int32_t			va_fileid;	/* file id */
! 	u_int64_t		va_size;	/* file size in bytes */
! 	u_int32_t		va_blocksize;	/* blocksize preferred for i/o */
! 	struct timespec32	va_atime;	/* time of last access */
! 	struct timespec32	va_mtime;	/* time of last modification */
! 	struct timespec32	va_ctime;	/* time file changed */
! 	u_int32_t		va_gen;		/* generation number of file */
! 	u_int32_t		va_flags;	/* flags defined for file */	
  	cdev_t	        	va_rdev;	/* device special file represents */
! 	u_int64_t		va_bytes;	/* bytes of disk space held by file */
! 	u_int64_t		va_filerev;	/* file modification number */
  };
  
  #endif 
***************
*** 358,377 ****
  /*
   *        Venus <-> Coda  RPC arguments
   */
! #ifndef sun
  struct coda_in_hdr {
!     unsigned long opcode;
!     unsigned long unique;	    /* Keep multiple outstanding msgs distinct */
!     u_short pid;		    /* Common to all */
!     u_short pgid;		    /* Common to all */
!     u_short sid;                    /* Common to all */
      struct coda_cred cred;	    /* Common to all */
  };
  #else
  /* Solaris uses longs for pid, pgid.... change to pid_t for all? */
  struct coda_in_hdr {
!     unsigned long opcode;
!     unsigned long unique;	    /* Keep multiple outstanding msgs distinct */
      pid_t pid;			    /* Common to all */
      pid_t pgid;			    /* Common to all */
      pid_t sid;                      /* Common to all */
--- 378,397 ----
  /*
   *        Venus <-> Coda  RPC arguments
   */
! #ifndef __sun
  struct coda_in_hdr {
!     u_int32_t opcode;
!     u_int32_t unique;	    /* Keep multiple outstanding msgs distinct */
!     u_int16_t pid;		    /* Common to all */
!     u_int16_t pgid;		    /* Common to all */
!     u_int16_t sid;                  /* Common to all */
      struct coda_cred cred;	    /* Common to all */
  };
  #else
  /* Solaris uses longs for pid, pgid.... change to pid_t for all? */
  struct coda_in_hdr {
!     u_int32_t opcode;
!     u_int32_t unique;	    /* Keep multiple outstanding msgs distinct */
      pid_t pid;			    /* Common to all */
      pid_t pgid;			    /* Common to all */
      pid_t sid;                      /* Common to all */
***************
*** 381,389 ****
  
  /* Really important that opcode and unique are 1st two fields! */
  struct coda_out_hdr {
!     unsigned long opcode;
!     unsigned long unique;	
!     unsigned long result;
  };
  
  /* coda_root: NO_IN */
--- 401,409 ----
  
  /* Really important that opcode and unique are 1st two fields! */
  struct coda_out_hdr {
!     u_int32_t opcode;
!     u_int32_t unique;	
!     u_int32_t result;
  };
  
  /* coda_root: NO_IN */
***************
*** 403,409 ****
  struct coda_open_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	flags;
  };
  
  struct coda_open_out {
--- 423,429 ----
  struct coda_open_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	flags;
  };
  
  struct coda_open_out {
***************
*** 417,423 ****
  struct coda_close_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	flags;
  };
  
  struct coda_close_out {
--- 437,443 ----
  struct coda_close_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	flags;
  };
  
  struct coda_close_out {
***************
*** 428,442 ****
  struct coda_ioctl_in {
      struct coda_in_hdr ih;
      ViceFid VFid;
!     int	cmd;
!     int	len;
!     int	rwflag;
      char *data;			/* Place holder for data. */
  };
  
  struct coda_ioctl_out {
      struct coda_out_hdr oh;
!     int	len;
      caddr_t	data;		/* Place holder for data. */
  };
  
--- 448,462 ----
  struct coda_ioctl_in {
      struct coda_in_hdr ih;
      ViceFid VFid;
!     int32_t	cmd;
!     int32_t	len;
!     int32_t	rwflag;
      char *data;			/* Place holder for data. */
  };
  
  struct coda_ioctl_out {
      struct coda_out_hdr oh;
!     int32_t	len;
      caddr_t	data;		/* Place holder for data. */
  };
  
***************
*** 468,474 ****
  struct coda_access_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	flags;
  };
  
  struct coda_access_out {
--- 488,494 ----
  struct coda_access_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	flags;
  };
  
  struct coda_access_out {
***************
*** 484,497 ****
  struct  coda_lookup_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int         name;		/* Place holder for data. */
!     int         flags;	
  };
  
  struct coda_lookup_out {
      struct coda_out_hdr oh;
      ViceFid VFid;
!     int	vtype;
  };
  
  
--- 504,517 ----
  struct  coda_lookup_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t     name;		/* Place holder for data. */
!     int32_t     flags;	
  };
  
  struct coda_lookup_out {
      struct coda_out_hdr oh;
      ViceFid VFid;
!     int32_t vtype;
  };
  
  
***************
*** 500,508 ****
      struct coda_in_hdr ih;
      ViceFid VFid;
      struct coda_vattr attr;
!     int excl;
!     int mode;
!     int 	name;		/* Place holder for data. */
  };
  
  struct coda_create_out {
--- 520,528 ----
      struct coda_in_hdr ih;
      ViceFid VFid;
      struct coda_vattr attr;
!     int32_t excl;
!     int32_t mode;
!     int32_t name;		/* Place holder for data. */
  };
  
  struct coda_create_out {
***************
*** 516,522 ****
  struct coda_remove_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int name;		/* Place holder for data. */
  };
  
  struct coda_remove_out {
--- 536,542 ----
  struct coda_remove_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t     name;		/* Place holder for data. */
  };
  
  struct coda_remove_out {
***************
*** 528,534 ****
      struct coda_in_hdr ih;
      ViceFid sourceFid;          /* cnode to link *to* */
      ViceFid destFid;            /* Directory in which to place link */
!     int tname;		/* Place holder for data. */
  };
  
  struct coda_link_out {
--- 548,554 ----
      struct coda_in_hdr ih;
      ViceFid sourceFid;          /* cnode to link *to* */
      ViceFid destFid;            /* Directory in which to place link */
!     int32_t tname;		/* Place holder for data. */
  };
  
  struct coda_link_out {
***************
*** 540,548 ****
  struct coda_rename_in {
      struct coda_in_hdr ih;
      ViceFid	sourceFid;
!     int 	srcname;
      ViceFid destFid;
!     int 	destname;
  };
  
  struct coda_rename_out {
--- 560,568 ----
  struct coda_rename_in {
      struct coda_in_hdr ih;
      ViceFid	sourceFid;
!     int32_t 	srcname;
      ViceFid destFid;
!     int32_t 	destname;
  };
  
  struct coda_rename_out {
***************
*** 554,560 ****
      struct coda_in_hdr ih;
      ViceFid	VFid;
      struct coda_vattr attr;
!     int	   name;		/* Place holder for data. */
  };
  
  struct coda_mkdir_out {
--- 574,580 ----
      struct coda_in_hdr ih;
      ViceFid	VFid;
      struct coda_vattr attr;
!     int32_t	   name;		/* Place holder for data. */
  };
  
  struct coda_mkdir_out {
***************
*** 568,574 ****
  struct coda_rmdir_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int name;		/* Place holder for data. */
  };
  
  struct coda_rmdir_out {
--- 588,594 ----
  struct coda_rmdir_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t     name;		/* Place holder for data. */
  };
  
  struct coda_rmdir_out {
***************
*** 579,591 ****
  struct coda_readdir_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	count;
!     int	offset;
  };
  
  struct coda_readdir_out {
      struct coda_out_hdr oh;
!     int	size;
      caddr_t	data;		/* Place holder for data. */
  };
  
--- 599,611 ----
  struct coda_readdir_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	count;
!     int32_t	offset;
  };
  
  struct coda_readdir_out {
      struct coda_out_hdr oh;
!     int32_t	size;
      caddr_t	data;		/* Place holder for data. */
  };
  
***************
*** 593,601 ****
  struct coda_symlink_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;          /* Directory to put symlink in */
!     int srcname;
      struct coda_vattr attr;
!     int tname;
  };
  
  struct coda_symlink_out {
--- 613,621 ----
  struct coda_symlink_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;          /* Directory to put symlink in */
!     int32_t srcname;
      struct coda_vattr attr;
!     int32_t tname;
  };
  
  struct coda_symlink_out {
***************
*** 610,616 ****
  
  struct coda_readlink_out {
      struct coda_out_hdr oh;
!     int	count;
      caddr_t	data;		/* Place holder for data. */
  };
  
--- 630,636 ----
  
  struct coda_readlink_out {
      struct coda_out_hdr oh;
!     int32_t	count;
      caddr_t	data;		/* Place holder for data. */
  };
  
***************
*** 640,646 ****
  struct coda_vget_out {
      struct coda_out_hdr oh;
      ViceFid VFid;
!     int	vtype;
  };
  
  
--- 660,666 ----
  struct coda_vget_out {
      struct coda_out_hdr oh;
      ViceFid VFid;
!     int32_t	vtype;
  };
  
  
***************
*** 688,694 ****
      struct coda_out_hdr oh;
      ViceFid CodaFid;
      struct coda_vattr attr;
!     int fd;
  };
  
  
--- 708,714 ----
      struct coda_out_hdr oh;
      ViceFid CodaFid;
      struct coda_vattr attr;
!     int32_t fd;
  };
  
  
***************
*** 696,712 ****
  struct coda_rdwr_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	rwflag;
!     int	count;
!     int	offset;
!     int	ioflag;
      caddr_t	data;		/* Place holder for data. */	
  };
  
  struct coda_rdwr_out {
      struct coda_out_hdr oh;
!     int	rwflag;
!     int	count;
      caddr_t	data;	/* Place holder for data. */
  };
  
--- 716,732 ----
  struct coda_rdwr_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	rwflag;
!     int32_t	count;
!     int32_t	offset;
!     int32_t	ioflag;
      caddr_t	data;		/* Place holder for data. */	
  };
  
  struct coda_rdwr_out {
      struct coda_out_hdr oh;
!     int32_t	rwflag;
!     int32_t	count;
      caddr_t	data;	/* Place holder for data. */
  };
  
***************
*** 723,734 ****
  struct coda_open_by_path_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int	flags;
  };
  
  struct coda_open_by_path_out {
      struct coda_out_hdr oh;
! 	int path;
  };
  
  /* coda_statfs: NO_IN */
--- 743,754 ----
  struct coda_open_by_path_in {
      struct coda_in_hdr ih;
      ViceFid	VFid;
!     int32_t	flags;
  };
  
  struct coda_open_by_path_out {
      struct coda_out_hdr oh;
! 	int32_t path;
  };
  
  /* coda_statfs: NO_IN */
***************
*** 817,829 ****
  #define PIOCPARM_MASK 0x0000ffff
  struct ViceIoctl {
          caddr_t in, out;        /* Data to be transferred in, or out */
!         short in_size;          /* Size of input buffer <= 2K */
!         short out_size;         /* Maximum size of output buffer, <= 2K */
  };
  
  struct PioctlData {
          const char *path;
!         int follow;
          struct ViceIoctl vi;
  };
  
--- 837,849 ----
  #define PIOCPARM_MASK 0x0000ffff
  struct ViceIoctl {
          caddr_t in, out;        /* Data to be transferred in, or out */
!         int16_t in_size;          /* Size of input buffer <= 2K */
!         int16_t out_size;         /* Maximum size of output buffer, <= 2K */
  };
  
  struct PioctlData {
          const char *path;
!         int32_t     follow;
          struct ViceIoctl vi;
  };
  
***************
*** 839,843 ****
  #define	IS_CTL_FID(fidp)	((fidp)->Volume == CTL_VOL &&\
  				 (fidp)->Vnode == CTL_VNO &&\
  				 (fidp)->Unique == CTL_UNI)
! #endif 
  
--- 859,863 ----
  #define	IS_CTL_FID(fidp)	((fidp)->Volume == CTL_VOL &&\
  				 (fidp)->Vnode == CTL_VNO &&\
  				 (fidp)->Unique == CTL_UNI)
! #endif /+ !_CODA_HEADER_ */
  
Only in solaris-coda-0.03_gisburn/include: coda.h.original
diff -r -c -w solaris-coda-0.03/include/coda_opstats.h solaris-coda-0.03_gisburn/include/coda_opstats.h
*** solaris-coda-0.03/include/coda_opstats.h	Fri Feb  4 18:36:58 2000
--- solaris-coda-0.03_gisburn/include/coda_opstats.h	Thu Sep 28 02:52:59 2000
***************
*** 74,85 ****
  
  
  struct coda_op_stats {
!     int opcode;       /* vfs opcode */
!     long entries;     /* number of times call attempted */
!     long sat_intrn;   /* number of times call satisfied by cache */
!     long unsat_intrn; /* number of times call failed in cache, but
                           was not bounced to venus proper. */
!     long gen_intrn;   /* number of times call generated internally */
                        /* (do we need that?) */
  };
  
--- 74,85 ----
  
  
  struct coda_op_stats {
!     int32_t opcode;       /* vfs opcode */
!     int32_t entries;     /* number of times call attempted */
!     int32_t sat_intrn;   /* number of times call satisfied by cache */
!     int32_t unsat_intrn; /* number of times call failed in cache, but
                           was not bounced to venus proper. */
!     int32_t gen_intrn;   /* number of times call generated internally */
                        /* (do we need that?) */
  };
  
Only in solaris-coda-0.03_gisburn/include: coda_opstats.h.original
Common subdirectories: solaris-coda-0.03/sol-include/CVS and solaris-coda-0.03_gisburn/sol-include/CVS
Common subdirectories: solaris-coda-0.03/src/CVS and solaris-coda-0.03_gisburn/src/CVS
diff -r -c -w solaris-coda-0.03/src/Makefile.in solaris-coda-0.03_gisburn/src/Makefile.in
*** solaris-coda-0.03/src/Makefile.in	Fri Feb  4 18:36:56 2000
--- solaris-coda-0.03_gisburn/src/Makefile.in	Wed Oct  4 23:48:56 2000
***************
*** 5,15 ****
  srcdir = ../src
  VPATH  = ../src
  
! CC=gcc
  
  INCLUDES	= -I$(TOPDIR)/include -I$(TOPDIR)/sol-include
! DEFS		= -D_KERNEL -DDEBUG
! CFLAGS		= -g -Wall $(DEFS) $(INCLUDES) 
  
  SRC		=				\
  		coda_debug.c			\
--- 5,15 ----
  srcdir = ../src
  VPATH  = ../src
  
! CC=/opt/SUNWspro/bin/cc
  
  INCLUDES	= -I$(TOPDIR)/include -I$(TOPDIR)/sol-include
! DEFS		= -Dsun -D_KERNEL -DDEBUG -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
! CFLAGS		= -g -Xa -xCC ${XARCH} $(DEFS) $(INCLUDES) 
  
  SRC		=				\
  		coda_debug.c			\
***************
*** 37,39 ****
--- 37,40 ----
  	etags $(SRC)
  
  .PHONY: all clean
+ 
Only in solaris-coda-0.03_gisburn/src: Makefile.in.original
diff -r -c -w solaris-coda-0.03/src/coda_upcalls.c solaris-coda-0.03_gisburn/src/coda_upcalls.c
*** solaris-coda-0.03/src/coda_upcalls.c	Fri Feb  4 18:36:56 2000
--- solaris-coda-0.03_gisburn/src/coda_upcalls.c	Thu Sep 28 09:59:49 2000
***************
*** 37,44 ****
--- 37,46 ----
  #include <coda_dev.h>
  #include <coda_debug.h>
  #include <coda_upcalls.h>
+ #include <sys/types.h>
  #include <sys/fcntl.h>
  
+ 
  /* Useful definitions */
  
  #define IN_SIZE(kind) sizeof(struct coda_ ## kind ## _in)
***************
*** 54,60 ****
  
  
  /* Useful functions */
! inline static void
  cred_sol2coda (cred_t *sol_cred, struct coda_cred *coda_cred)
  {
    bzero((char *)coda_cred,sizeof(struct coda_cred));
--- 56,62 ----
  
  
  /* Useful functions */
! static void
  cred_sol2coda (cred_t *sol_cred, struct coda_cred *coda_cred)
  {
    bzero((char *)coda_cred,sizeof(struct coda_cred));
***************
*** 74,79 ****
--- 76,86 ----
  static vtype_t coda2vtype[]
  	= {VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD};
  
+ 
+ #define timespec2timespec( a, b )  (a).tv_sec = (b).tv_sec; (a).tv_nsec = (b).tv_nsec;
+ 
+ 
+ 
  static void
  coda_attr2vattr(struct coda_vattr *cap, struct vattr *vap)
  {
***************
*** 88,96 ****
--- 95,109 ----
    vap->va_nodeid  = cap->va_fileid;
    vap->va_nlink   = cap->va_nlink;
    vap->va_size    = cap->va_size;
+ #if 0  
    vap->va_atime   = cap->va_atime;
    vap->va_mtime   = cap->va_mtime;
    vap->va_ctime   = cap->va_ctime;
+ #else
+   timespec2timespec( vap->va_atime, cap->va_atime );
+   timespec2timespec( vap->va_mtime, cap->va_mtime );
+   timespec2timespec( vap->va_ctime, cap->va_ctime );
+ #endif  
    vap->va_blksize = cap->va_blocksize;
    vap->va_nblocks = (cap->va_size+511)/512;
    vap->va_rdev    = cap->va_rdev;
***************
*** 122,131 ****
    cap->va_uid    = ( vap->va_mask & AT_UID ? vap->va_uid : -1);
    cap->va_gid    = ( vap->va_mask & AT_GID ? vap->va_gid : -1);
    cap->va_size   = ( vap->va_mask & AT_SIZE ? vap->va_size : -1);
    cap->va_atime  = ( vap->va_mask & AT_ATIME ? vap->va_atime : notime);
    cap->va_mtime  = ( vap->va_mask & AT_MTIME ? vap->va_mtime : notime);
    cap->va_ctime  = ( vap->va_mask & AT_CTIME ? vap->va_ctime : notime);
! 
    CODADEB (CDEBUPC, (CE_NOTE, "vattr2coda_attr: mask=0x%x", vap->va_mask));
    CODADEB (CDEBUPC, (CE_NOTE, "mode 0%o, uid %d, gid %d, size %d",
  		     cap->va_mode, cap->va_uid, cap->va_gid, cap->va_size));
--- 135,149 ----
    cap->va_uid    = ( vap->va_mask & AT_UID ? vap->va_uid : -1);
    cap->va_gid    = ( vap->va_mask & AT_GID ? vap->va_gid : -1);
    cap->va_size   = ( vap->va_mask & AT_SIZE ? vap->va_size : -1);
+ #if 0  
    cap->va_atime  = ( vap->va_mask & AT_ATIME ? vap->va_atime : notime);
    cap->va_mtime  = ( vap->va_mask & AT_MTIME ? vap->va_mtime : notime);
    cap->va_ctime  = ( vap->va_mask & AT_CTIME ? vap->va_ctime : notime);
! #else
!   timespec2timespec( cap->va_atime, ( vap->va_mask & AT_ATIME ? vap->va_atime : notime) );
!   timespec2timespec( cap->va_mtime, ( vap->va_mask & AT_MTIME ? vap->va_mtime : notime) );
!   timespec2timespec( cap->va_ctime, ( vap->va_mask & AT_CTIME ? vap->va_ctime : notime) );
! #endif
    CODADEB (CDEBUPC, (CE_NOTE, "vattr2coda_attr: mask=0x%x", vap->va_mask));
    CODADEB (CDEBUPC, (CE_NOTE, "mode 0%o, uid %d, gid %d, size %d",
  		     cap->va_mode, cap->va_uid, cap->va_gid, cap->va_size));

/* 
   You may distribute this file under either of the two licenses that
   follow at your discretion.
*/

/* BLURB lgpl

                           Coda File System
                              Release 5

          Copyright (c) 1987-1999 Carnegie Mellon University
                  Additional copyrights listed below

This code is distributed "AS IS" without warranty of any kind under
the terms of the GNU Library General Public Licence Version 2, as
shown in the file LICENSE, or under the license shown below. The
technical and financial contributors to Coda are listed in the file
CREDITS.

                        Additional copyrights 
*/

/*

            Coda: an Experimental Distributed File System
                             Release 4.0

          Copyright (c) 1987-1999 Carnegie Mellon University
                         All Rights Reserved

Permission  to  use, copy, modify and distribute this software and its
documentation is hereby granted,  provided  that  both  the  copyright
notice  and  this  permission  notice  appear  in  all  copies  of the
software, derivative works or  modified  versions,  and  any  portions
thereof, and that both notices appear in supporting documentation, and
that credit is given to Carnegie Mellon University  in  all  documents
and publicity pertaining to direct or indirect use of this code or its
derivatives.

CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS  KNOWN  TO  HAVE  BUGS,
SOME  OF  WHICH MAY HAVE SERIOUS CONSEQUENCES.  CARNEGIE MELLON ALLOWS
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.   CARNEGIE  MELLON
DISCLAIMS  ANY  LIABILITY  OF  ANY  KIND  FOR  ANY  DAMAGES WHATSOEVER
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE  OR  OF
ANY DERIVATIVE WORK.

Carnegie  Mellon  encourages  users  of  this  software  to return any
improvements or extensions that  they  make,  and  to  grant  Carnegie
Mellon the rights to redistribute these changes without encumbrance.
*/

/*
 *
 * Based on cfs.h from Mach, but revamped for increased simplicity.
 * Linux modifications by 
 * Peter Braam, Aug 1996
 */

#ifndef _CODA_HEADER_
#define _CODA_HEADER_



/* Catch new _KERNEL defn for NetBSD */
#ifdef __NetBSD__
#include <sys/types.h>
#endif 

#ifndef CODA_MAXSYMLINKS
#define CODA_MAXSYMLINKS 10
#endif

#if defined(DJGPP) || defined(__CYGWIN32__)
#ifdef KERNEL
typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef u_long ino_t;
typedef u_long dev_t;
typedef void * caddr_t;
#ifdef DOS
typedef unsigned __int64 u_quad_t;
#else 
typedef unsigned long long u_quad_t;
#endif

#define inline

struct timespec {
        long       ts_sec;
        long       ts_nsec;
};
#else  /* DJGPP but not KERNEL */
#include <sys/types.h>
#include <sys/time.h>
typedef unsigned long long u_quad_t;
#endif /* !KERNEL */
#endif /* !DJGPP */


#if defined(__linux__)
#define cdev_t u_quad_t
#ifndef __KERNEL__
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
#define _UQUAD_T_ 1
typedef unsigned long long u_quad_t;
#endif
#else /*__KERNEL__ */
typedef unsigned long long u_quad_t;
#endif /* __KERNEL__ */
#else
#define cdev_t dev_t
#endif

/* Solaris Definitions */
#if defined(sun)
#include <sys/types.h>
#include <sys/time.h>
#define __BIT_TYPES_DEFINED__
typedef unsigned char       u_int8_t;
typedef unsigned short     u_int16_t;
typedef unsigned int       u_int32_t;
typedef unsigned long long u_quad_t;
#endif

#ifdef __CYGWIN32__
struct timespec {
        time_t  tv_sec;         /* seconds */
        long    tv_nsec;        /* nanoseconds */
};
#endif

#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef signed char	      int8_t;
typedef unsigned char	    u_int8_t;
typedef short		     int16_t;
typedef unsigned short	   u_int16_t;
typedef int		     int32_t;
typedef unsigned int	   u_int32_t;
#endif


/*
 * Cfs constants
 */
#define CODA_MAXNAMLEN   255
#define CODA_MAXPATHLEN  1024
#define CODA_MAXSYMLINK  10

/* these are Coda's version of O_RDONLY etc combinations
 * to deal with VFS open modes
 */
#define	C_O_READ	0x001
#define	C_O_WRITE       0x002
#define C_O_TRUNC       0x010
#define C_O_EXCL	0x100
#define C_O_CREAT	0x200

/* these are to find mode bits in Venus */ 
#define C_M_READ  00400
#define C_M_WRITE 00200

/* for access Venus will use */
#define C_A_C_OK    8               /* Test for writing upon create.  */
#define C_A_R_OK    4               /* Test for read permission.  */
#define C_A_W_OK    2               /* Test for write permission.  */
#define C_A_X_OK    1               /* Test for execute permission.  */
#define C_A_F_OK    0               /* Test for existence.  */

#if defined(sun)
#define _VENUS_DIRENT_T_ 1
struct venus_dirent {
        unsigned long	d_fileno;		/* file number of entry */
        unsigned short	d_reclen;		/* length of this record */
        unsigned short	d_namlen;		/* length of string in d_name */
        char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
};
#undef DIRSIZ
#define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
                         (((dp)->d_namlen+1 + 3) &~ 3))
#endif

#ifndef _VENUS_DIRENT_T_
#define _VENUS_DIRENT_T_ 1
struct venus_dirent {
        unsigned long	d_fileno;		/* file number of entry */
        unsigned short	d_reclen;		/* length of this record */
        unsigned char 	d_type;			/* file type, see below */
        unsigned char	d_namlen;		/* length of string in d_name */
        char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
};
#undef DIRSIZ
#define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
                         (((dp)->d_namlen+1 + 3) &~ 3))

/*
 * File types
 */
#define	CDT_UNKNOWN	 0
#define	CDT_FIFO	 1
#define	CDT_CHR		 2
#define	CDT_DIR		 4
#define	CDT_BLK		 6
#define	CDT_REG		 8
#define	CDT_LNK		10
#define	CDT_SOCK	12
#define	CDT_WHT		14

/*
 * Convert between stat structure types and directory types.
 */
#define	IFTOCDT(mode)	(((mode) & 0170000) >> 12)
#define	CDTTOIF(dirtype)	((dirtype) << 12)

#endif

#ifndef	_FID_T_
#define _FID_T_	1
typedef u_long VolumeId;
typedef u_long VnodeId;
typedef u_long Unique_t;
typedef u_long FileVersion;
#endif 

#ifndef	_VICEFID_T_
#define _VICEFID_T_	1
typedef struct ViceFid {
    VolumeId Volume;
    VnodeId Vnode;
    Unique_t Unique;
} ViceFid;
#endif	/* VICEFID */


#ifdef __linux__
static __inline__ ino_t  coda_f2i(struct ViceFid *fid)
{
	if ( ! fid ) 
		return 0; 
	if (fid->Vnode == 0xfffffffe || fid->Vnode == 0xffffffff)
		return ((fid->Volume << 20) | (fid->Unique & 0xfffff));
	else
		return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
}
	
#else
#define coda_f2i(fid)\
	((fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0)
#endif


#ifndef _VUID_T_
#define _VUID_T_
typedef u_int32_t vuid_t;
typedef u_int32_t vgid_t;
#endif /*_VUID_T_ */

#ifndef _CODACRED_T_
#define _CODACRED_T_
struct coda_cred {
    vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
    vgid_t cr_groupid,     cr_egid, cr_sgid, cr_fsgid; /* same for groups */
};
#endif 

#ifndef _VENUS_VATTR_T_
#define _VENUS_VATTR_T_
/*
 * Vnode types.  VNON means no type.
 */
enum coda_vtype	{ C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };

struct coda_vattr {
	long     	va_type;	/* vnode type (for create) */
	u_short		va_mode;	/* files access mode and type */
	short		va_nlink;	/* number of references to file */
	vuid_t		va_uid;		/* owner user id */
	vgid_t		va_gid;		/* owner group id */
	long		va_fileid;	/* file id */
	u_quad_t	va_size;	/* file size in bytes */
	long		va_blocksize;	/* blocksize preferred for i/o */
	struct timespec	va_atime;	/* time of last access */
	struct timespec	va_mtime;	/* time of last modification */
	struct timespec	va_ctime;	/* time file changed */
	u_long		va_gen;		/* generation number of file */
	u_long		va_flags;	/* flags defined for file */
	cdev_t	        va_rdev;	/* device special file represents */
	u_quad_t	va_bytes;	/* bytes of disk space held by file */
	u_quad_t	va_filerev;	/* file modification number */
};

#endif 

/* structure used by CODA_STATFS for getting cache information from venus */
struct coda_statfs {
    int32_t f_blocks;
    int32_t f_bfree;
    int32_t f_bavail;
    int32_t f_files;
    int32_t f_ffree;
};

/*
 * Kernel <--> Venus communications.
 */

#define CODA_ROOT	2
#define CODA_OPEN	4
#define CODA_CLOSE	5
#define CODA_IOCTL	6
#define CODA_GETATTR	7
#define CODA_SETATTR	8
#define CODA_ACCESS	9
#define CODA_LOOKUP	10
#define CODA_CREATE	11
#define CODA_REMOVE	12
#define CODA_LINK	13
#define CODA_RENAME	14
#define CODA_MKDIR	15
#define CODA_RMDIR	16
#define CODA_SYMLINK	18
#define CODA_READLINK	19
#define CODA_FSYNC	20
#define CODA_VGET	22
#define CODA_SIGNAL	23
#define CODA_REPLACE	 24 /* DOWNCALL */
#define CODA_FLUSH       25 /* DOWNCALL */
#define CODA_PURGEUSER   26 /* DOWNCALL */
#define CODA_ZAPFILE     27 /* DOWNCALL */
#define CODA_ZAPDIR      28 /* DOWNCALL */
#define CODA_PURGEFID    30 /* DOWNCALL */
#define CODA_OPEN_BY_PATH 31
#define CODA_RESOLVE     32
#define CODA_REINTEGRATE 33
#define CODA_STATFS	 34
#define CODA_MAKE_CINODE 35 /* DOWNCALL */
#define CODA_NCALLS 36

#define DOWNCALL(opcode) \
	((opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) || \
	 opcode == CODA_MAKE_CINODE)

#define VC_MAXDATASIZE	    8192
#define VC_MAXMSGSIZE      sizeof(union inputArgs)+sizeof(union outputArgs) +\
                            VC_MAXDATASIZE  

#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int))

#if 0
#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
/* Only linux-2.3 kernels use venus-kernel protocol version 3 */
#define CODA_KERNEL_VERSION 3 /* added CODA_MAKE_CINODE downcall */
#endif
#define CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */

/*
 *        Venus <-> Coda  RPC arguments
 */
#ifndef sun
struct coda_in_hdr {
    unsigned long opcode;
    unsigned long unique;	    /* Keep multiple outstanding msgs distinct */
    u_short pid;		    /* Common to all */
    u_short pgid;		    /* Common to all */
    u_short sid;                    /* Common to all */
    struct coda_cred cred;	    /* Common to all */
};
#else
/* Solaris uses longs for pid, pgid.... change to pid_t for all? */
struct coda_in_hdr {
    unsigned long opcode;
    unsigned long unique;	    /* Keep multiple outstanding msgs distinct */
    pid_t pid;			    /* Common to all */
    pid_t pgid;			    /* Common to all */
    pid_t sid;                      /* Common to all */
    struct coda_cred cred;	    /* Common to all */
};
#endif

/* Really important that opcode and unique are 1st two fields! */
struct coda_out_hdr {
    unsigned long opcode;
    unsigned long unique;	
    unsigned long result;
};

/* coda_root: NO_IN */
struct coda_root_out {
    struct coda_out_hdr oh;
    ViceFid VFid;
};

struct coda_root_in {
    struct coda_in_hdr in;
};

/* coda_sync: */
/* Nothing needed for coda_sync */

/* coda_open: */
struct coda_open_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	flags;
};

struct coda_open_out {
    struct coda_out_hdr oh;
    cdev_t	dev;
    ino_t	inode;
};


/* coda_close: */
struct coda_close_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	flags;
};

struct coda_close_out {
    struct coda_out_hdr out;
};

/* coda_ioctl: */
struct coda_ioctl_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
    int	cmd;
    int	len;
    int	rwflag;
    char *data;			/* Place holder for data. */
};

struct coda_ioctl_out {
    struct coda_out_hdr oh;
    int	len;
    caddr_t	data;		/* Place holder for data. */
};


/* coda_getattr: */
struct coda_getattr_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
};

struct coda_getattr_out {
    struct coda_out_hdr oh;
    struct coda_vattr attr;
};


/* coda_setattr: NO_OUT */
struct coda_setattr_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
    struct coda_vattr attr;
};

struct coda_setattr_out {
    struct coda_out_hdr out;
};

/* coda_access: NO_OUT */
struct coda_access_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	flags;
};

struct coda_access_out {
    struct coda_out_hdr out;
};


/* lookup flags */
#define CLU_CASE_SENSITIVE     0x01
#define CLU_CASE_INSENSITIVE   0x02

/* coda_lookup: */
struct  coda_lookup_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int         name;		/* Place holder for data. */
    int         flags;	
};

struct coda_lookup_out {
    struct coda_out_hdr oh;
    ViceFid VFid;
    int	vtype;
};


/* coda_create: */
struct coda_create_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
    struct coda_vattr attr;
    int excl;
    int mode;
    int 	name;		/* Place holder for data. */
};

struct coda_create_out {
    struct coda_out_hdr oh;
    ViceFid VFid;
    struct coda_vattr attr;
};


/* coda_remove: NO_OUT */
struct coda_remove_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int name;		/* Place holder for data. */
};

struct coda_remove_out {
    struct coda_out_hdr out;
};

/* coda_link: NO_OUT */
struct coda_link_in {
    struct coda_in_hdr ih;
    ViceFid sourceFid;          /* cnode to link *to* */
    ViceFid destFid;            /* Directory in which to place link */
    int tname;		/* Place holder for data. */
};

struct coda_link_out {
    struct coda_out_hdr out;
};


/* coda_rename: NO_OUT */
struct coda_rename_in {
    struct coda_in_hdr ih;
    ViceFid	sourceFid;
    int 	srcname;
    ViceFid destFid;
    int 	destname;
};

struct coda_rename_out {
    struct coda_out_hdr out;
};

/* coda_mkdir: */
struct coda_mkdir_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    struct coda_vattr attr;
    int	   name;		/* Place holder for data. */
};

struct coda_mkdir_out {
    struct coda_out_hdr oh;
    ViceFid VFid;
    struct coda_vattr attr;
};


/* coda_rmdir: NO_OUT */
struct coda_rmdir_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int name;		/* Place holder for data. */
};

struct coda_rmdir_out {
    struct coda_out_hdr out;
};

/* coda_readdir: */
struct coda_readdir_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	count;
    int	offset;
};

struct coda_readdir_out {
    struct coda_out_hdr oh;
    int	size;
    caddr_t	data;		/* Place holder for data. */
};

/* coda_symlink: NO_OUT */
struct coda_symlink_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;          /* Directory to put symlink in */
    int srcname;
    struct coda_vattr attr;
    int tname;
};

struct coda_symlink_out {
    struct coda_out_hdr out;
};

/* coda_readlink: */
struct coda_readlink_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
};

struct coda_readlink_out {
    struct coda_out_hdr oh;
    int	count;
    caddr_t	data;		/* Place holder for data. */
};


/* coda_fsync: NO_OUT */
struct coda_fsync_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
};

struct coda_fsync_out {
    struct coda_out_hdr out;
};

/* coda_inactive: NO_OUT */
struct coda_inactive_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
};

/* coda_vget: */
struct coda_vget_in {
    struct coda_in_hdr ih;
    ViceFid VFid;
};

struct coda_vget_out {
    struct coda_out_hdr oh;
    ViceFid VFid;
    int	vtype;
};


/* CODA_SIGNAL is out-of-band, doesn't need data. */
/* CODA_INVALIDATE is a venus->kernel call */
/* CODA_FLUSH is a venus->kernel call */

/* coda_purgeuser: */
/* CODA_PURGEUSER is a venus->kernel call */
struct coda_purgeuser_out {
    struct coda_out_hdr oh;
    struct coda_cred cred;
};

/* coda_zapfile: */
/* CODA_ZAPFILE is a venus->kernel call */
struct coda_zapfile_out {  
    struct coda_out_hdr oh;
    ViceFid CodaFid;
};

/* coda_zapdir: */
/* CODA_ZAPDIR is a venus->kernel call */	
struct coda_zapdir_out {	  
    struct coda_out_hdr oh;
    ViceFid CodaFid;
};

/* coda_zapnode: */
/* CODA_ZAPVNODE is a venus->kernel call */	
struct coda_zapvnode_out { 
    struct coda_out_hdr oh;
    struct coda_cred cred;
    ViceFid VFid;
};

/* coda_purgefid: */
/* CODA_PURGEFID is a venus->kernel call */	
struct coda_purgefid_out { 
    struct coda_out_hdr oh;
    ViceFid CodaFid;
};

struct coda_make_cinode_out {
    struct coda_out_hdr oh;
    ViceFid CodaFid;
    struct coda_vattr attr;
    int fd;
};


/* coda_rdwr: */
struct coda_rdwr_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	rwflag;
    int	count;
    int	offset;
    int	ioflag;
    caddr_t	data;		/* Place holder for data. */	
};

struct coda_rdwr_out {
    struct coda_out_hdr oh;
    int	rwflag;
    int	count;
    caddr_t	data;	/* Place holder for data. */
};


/* coda_replace: */
/* CODA_REPLACE is a venus->kernel call */	
struct coda_replace_out { /* coda_replace is a venus->kernel call */
    struct coda_out_hdr oh;
    ViceFid NewFid;
    ViceFid OldFid;
};

/* coda_open_by_path: */
struct coda_open_by_path_in {
    struct coda_in_hdr ih;
    ViceFid	VFid;
    int	flags;
};

struct coda_open_by_path_out {
    struct coda_out_hdr oh;
	int path;
};

/* coda_statfs: NO_IN */
struct coda_statfs_in {
    struct coda_in_hdr in;
};

struct coda_statfs_out {
    struct coda_out_hdr oh;
    struct coda_statfs stat;
};

/* 
 * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 
 * For instance, if the fid is inconsistent. 
 * This case is handled by setting the top bit of the type result parameter.
 */
#define CODA_NOCACHE          0x80000000

union inputArgs {
    struct coda_in_hdr ih;		/* NB: every struct below begins with an ih */
    struct coda_open_in coda_open;
    struct coda_close_in coda_close;
    struct coda_ioctl_in coda_ioctl;
    struct coda_getattr_in coda_getattr;
    struct coda_setattr_in coda_setattr;
    struct coda_access_in coda_access;
    struct coda_lookup_in coda_lookup;
    struct coda_create_in coda_create;
    struct coda_remove_in coda_remove;
    struct coda_link_in coda_link;
    struct coda_rename_in coda_rename;
    struct coda_mkdir_in coda_mkdir;
    struct coda_rmdir_in coda_rmdir;
    struct coda_readdir_in coda_readdir;
    struct coda_symlink_in coda_symlink;
    struct coda_readlink_in coda_readlink;
    struct coda_fsync_in coda_fsync;
    struct coda_inactive_in coda_inactive;
    struct coda_vget_in coda_vget;
    struct coda_rdwr_in coda_rdwr;
    struct coda_open_by_path_in coda_open_by_path;
    struct coda_statfs_in coda_statfs;
};

union outputArgs {
    struct coda_out_hdr oh;		/* NB: every struct below begins with an oh */
    struct coda_root_out coda_root;
    struct coda_open_out coda_open;
    struct coda_ioctl_out coda_ioctl;
    struct coda_getattr_out coda_getattr;
    struct coda_lookup_out coda_lookup;
    struct coda_create_out coda_create;
    struct coda_mkdir_out coda_mkdir;
    struct coda_readdir_out coda_readdir;
    struct coda_readlink_out coda_readlink;
    struct coda_vget_out coda_vget;
    struct coda_purgeuser_out coda_purgeuser;
    struct coda_zapfile_out coda_zapfile;
    struct coda_zapdir_out coda_zapdir;
    struct coda_zapvnode_out coda_zapvnode;
    struct coda_purgefid_out coda_purgefid;
    struct coda_rdwr_out coda_rdwr;
    struct coda_replace_out coda_replace;
    struct coda_make_cinode_out coda_make_cinode;
    struct coda_open_by_path_out coda_open_by_path;
    struct coda_statfs_out coda_statfs;
};    

union coda_downcalls {
    /* CODA_INVALIDATE is a venus->kernel call */
    /* CODA_FLUSH is a venus->kernel call */
    struct coda_purgeuser_out purgeuser;
    struct coda_zapfile_out zapfile;
    struct coda_zapdir_out zapdir;
    struct coda_zapvnode_out zapvnode;
    struct coda_purgefid_out purgefid;
    struct coda_replace_out replace;
};


/*
 * Used for identifying usage of "Control" and pioctls
 */

#define PIOCPARM_MASK 0x0000ffff
struct ViceIoctl {
        caddr_t in, out;        /* Data to be transferred in, or out */
        short in_size;          /* Size of input buffer <= 2K */
        short out_size;         /* Maximum size of output buffer, <= 2K */
};

struct PioctlData {
        const char *path;
        int follow;
        struct ViceIoctl vi;
};

#define	CODA_CONTROL		".CONTROL"
#define CODA_CONTROLLEN           8
#define	CTL_VOL			-1
#define	CTL_VNO			-1
#define	CTL_UNI			-1
#define CTL_INO                 -1
#define	CTL_FILE		"/coda/.CONTROL"


#define	IS_CTL_FID(fidp)	((fidp)->Volume == CTL_VOL &&\
				 (fidp)->Vnode == CTL_VNO &&\
				 (fidp)->Unique == CTL_UNI)
#endif 
Received on 2000-10-10 10:34:45