Author: rwatson
Date: Mon Apr  5 20:12:54 2010
New Revision: 206210
URL: http://svn.freebsd.org/changeset/base/206210

Log:
  Synchronize Coda kernel module definitions in our coda.h to Coda 6's
  coda.h:
  
  - CodaFid typdef -> struct CodaFid throughout.
  - Use unsigned int instead of unsigned long for venus_dirent and other
    cosmetic fixes.
  - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs.
  - Synchronize comments and macros.
  - Use u_int32_t instead of unsigned long for coda_out_hdr.
  
  With these changes, a 64-bit Coda kernel module now works with
  coda6_client, whereas previous userspace and kernel versions of RPCs
  differed sufficiently to prevent using the file system.  This has been
  verified only with casual testing, but /coda is now usable for at least
  basic operations on amd64.
  
  MFC after:    1 week

Modified:
  head/sys/fs/coda/cnode.h
  head/sys/fs/coda/coda.h
  head/sys/fs/coda/coda_subr.c
  head/sys/fs/coda/coda_subr.h
  head/sys/fs/coda/coda_venus.c
  head/sys/fs/coda/coda_venus.h
  head/sys/fs/coda/coda_vfsops.c
  head/sys/fs/coda/coda_vfsops.h
  head/sys/fs/coda/coda_vnops.c

Modified: head/sys/fs/coda/cnode.h
==============================================================================
--- head/sys/fs/coda/cnode.h    Mon Apr  5 20:01:21 2010        (r206209)
+++ head/sys/fs/coda/cnode.h    Mon Apr  5 20:12:54 2010        (r206210)
@@ -94,7 +94,7 @@ extern int coda_vfsop_print_entry;
 struct cnode {
        struct vnode    *c_vnode;
        u_short          c_flags;       /* flags (see below) */
-       CodaFid          c_fid;         /* file handle */
+       struct CodaFid   c_fid;         /* file handle */
        struct vnode    *c_ovp;         /* open vnode pointer */
        u_short          c_ocount;      /* count of openers */
        u_short          c_owrite;      /* count of open for write */
@@ -196,7 +196,8 @@ void        coda_unmounting(struct mount *whoIa
 int    coda_vmflush(struct cnode *cp);
 
 /* cfs_vnodeops.h */
-struct cnode   *make_coda_node(CodaFid *fid, struct mount *vfsp, short type);
+struct cnode   *make_coda_node(struct CodaFid *fid, struct mount *vfsp,
+                short type);
 int             coda_vnodeopstats_init(void);
 
 /* sigh */

Modified: head/sys/fs/coda/coda.h
==============================================================================
--- head/sys/fs/coda/coda.h     Mon Apr  5 20:01:21 2010        (r206209)
+++ head/sys/fs/coda/coda.h     Mon Apr  5 20:12:54 2010        (r206210)
@@ -103,6 +103,8 @@ struct timespec {
 };
 #endif
 
+typedef u_int32_t cuid_t;
+typedef u_int32_t cgid_t;
 
 /*
  * Cfs constants
@@ -132,14 +134,13 @@ struct timespec {
 #define C_A_F_OK    0               /* Test for existence.  */
 
 
-
 #ifndef _VENUS_DIRENT_T_
 #define _VENUS_DIRENT_T_ 1
 struct venus_dirent {
-        unsigned long  d_fileno;               /* file number of entry */
+        unsigned int   d_fileno;               /* file number of entry */
         unsigned short d_reclen;               /* length of this record */
-        char           d_type;                 /* file type, see below */
-        char           d_namlen;               /* length of string in d_name */
+        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
@@ -169,19 +170,19 @@ struct venus_dirent {
 
 #ifdef CODA_COMPAT_5
 
-typedef struct {
+struct CodaFid {
     u_long Volume;
     u_long Vnode;
     u_long Unique;      
-} CodaFid;
+};
 
-static __inline__ ino_t coda_f2i(CodaFid *fid)
+static __inline__ ino_t coda_f2i(struct CodaFid *fid)
 {
        if (!fid) return 0;
        return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
 }
 
-static __inline__ char * coda_f2s(CodaFid *fid)
+static __inline__ char * coda_f2s(struct CodaFid *fid)
 {
   static char fid_str [35];
   snprintf (fid_str, 35, "[%lx.%lx.%lx]", fid->Volume,
@@ -189,7 +190,7 @@ static __inline__ char * coda_f2s(CodaFi
   return fid_str;
 }
  
-static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
+static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2)
 {
   return (fid1->Volume == fid2->Volume &&
          fid1->Vnode == fid2->Vnode &&
@@ -203,18 +204,18 @@ struct coda_cred {
 
 #else  /* CODA_COMPAT_5 */
 
-typedef struct  {
+struct CodaFid {
        u_int32_t opaque[4];
-} CodaFid;
+};
 
-static __inline__ ino_t  coda_f2i(CodaFid *fid)
+static __inline__ ino_t  coda_f2i(struct CodaFid *fid)
 {
     if ( ! fid ) 
        return 0; 
     return (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ 
fid->opaque[0]);
 }
        
-static __inline__ char * coda_f2s(CodaFid *fid)
+static __inline__ char * coda_f2s(struct CodaFid *fid)
  {
      static char fid_str [35];
      snprintf (fid_str, 35, "[%x.%x.%x.%x]", fid->opaque[0],
@@ -222,7 +223,7 @@ static __inline__ char * coda_f2s(CodaFi
      return fid_str;
  }
 
-static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
+static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2)
 {
   return (fid1->opaque[0] == fid2->opaque[0] &&
          fid1->opaque[1] == fid2->opaque[1] &&
@@ -240,11 +241,11 @@ static __inline__ int coda_fid_eq (CodaF
 enum coda_vtype        { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, 
C_VSOCK, C_VFIFO, C_VBAD };
 
 struct coda_vattr {
-       int             va_type;        /* vnode type (for create) */
+       long            va_type;        /* vnode type (for create) */
        u_short         va_mode;        /* files access mode and type */
        short           va_nlink;       /* number of references to file */
-       uid_t           va_uid;         /* owner user id */
-       gid_t           va_gid;         /* owner group id */
+       cuid_t          va_uid;         /* owner user id */
+       cgid_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 */
@@ -344,23 +345,23 @@ struct coda_in_hdr {
 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 */
-    uid_t uid;             /* Common to all */
+    pid_t pid;
+    pid_t pgid;
+    cuid_t uid;
 };
 #endif
 
 /* Really important that opcode and unique are 1st two fields! */
 struct coda_out_hdr {
-    unsigned long opcode;
-    unsigned long unique;      
-    unsigned long result;
+    u_int32_t opcode;
+    u_int32_t unique;  
+    u_int32_t result;
 };
 
 /* coda_root: NO_IN */
 struct coda_root_out {
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 struct coda_root_in {
@@ -373,7 +374,7 @@ struct coda_root_in {
 /* coda_open: */
 struct coda_open_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int        flags;
 };
 
@@ -387,7 +388,7 @@ struct coda_open_out {
 /* coda_close: */
 struct coda_close_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int        flags;
 };
 
@@ -398,7 +399,7 @@ struct coda_close_out {
 /* coda_ioctl: */
 struct coda_ioctl_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
     int        cmd;
     int        len;
     int        rwflag;
@@ -415,7 +416,7 @@ struct coda_ioctl_out {
 /* coda_getattr: */
 struct coda_getattr_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 struct coda_getattr_out {
@@ -427,7 +428,7 @@ struct coda_getattr_out {
 /* coda_setattr: NO_OUT */
 struct coda_setattr_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
     struct coda_vattr attr;
 };
 
@@ -438,7 +439,7 @@ struct coda_setattr_out {
 /* coda_access: NO_OUT */
 struct coda_access_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int        flags;
 };
 
@@ -454,14 +455,14 @@ struct coda_access_out {
 /* coda_lookup: */
 struct  coda_lookup_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int         name;          /* Place holder for data. */
     int         flags; 
 };
 
 struct coda_lookup_out {
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
     int        vtype;
 };
 
@@ -469,7 +470,7 @@ struct coda_lookup_out {
 /* coda_create: */
 struct coda_create_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
     struct coda_vattr attr;
     int excl;
     int mode;
@@ -478,7 +479,7 @@ struct coda_create_in {
 
 struct coda_create_out {
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
     struct coda_vattr attr;
 };
 
@@ -486,7 +487,7 @@ struct coda_create_out {
 /* coda_remove: NO_OUT */
 struct coda_remove_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int name;          /* Place holder for data. */
 };
 
@@ -497,8 +498,8 @@ struct coda_remove_out {
 /* coda_link: NO_OUT */
 struct coda_link_in {
     struct coda_in_hdr ih;
-    CodaFid sourceFid;          /* cnode to link *to* */
-    CodaFid destFid;            /* Directory in which to place link */
+    struct CodaFid sourceFid;          /* cnode to link *to* */
+    struct CodaFid destFid;            /* Directory in which to place link */
     int tname;         /* Place holder for data. */
 };
 
@@ -510,9 +511,9 @@ struct coda_link_out {
 /* coda_rename: NO_OUT */
 struct coda_rename_in {
     struct coda_in_hdr ih;
-    CodaFid    sourceFid;
+    struct CodaFid     sourceFid;
     int        srcname;
-    CodaFid destFid;
+    struct CodaFid destFid;
     int        destname;
 };
 
@@ -523,14 +524,14 @@ struct coda_rename_out {
 /* coda_mkdir: */
 struct coda_mkdir_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     struct coda_vattr attr;
     int           name;                /* Place holder for data. */
 };
 
 struct coda_mkdir_out {
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
     struct coda_vattr attr;
 };
 
@@ -538,7 +539,7 @@ struct coda_mkdir_out {
 /* coda_rmdir: NO_OUT */
 struct coda_rmdir_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int name;          /* Place holder for data. */
 };
 
@@ -549,7 +550,7 @@ struct coda_rmdir_out {
 /* coda_readdir: */
 struct coda_readdir_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int        count;
     int        offset;
 };
@@ -563,7 +564,7 @@ struct coda_readdir_out {
 /* coda_symlink: NO_OUT */
 struct coda_symlink_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;          /* Directory to put symlink in */
+    struct CodaFid     Fid;          /* Directory to put symlink in */
     int srcname;
     struct coda_vattr attr;
     int tname;
@@ -576,7 +577,7 @@ struct coda_symlink_out {
 /* coda_readlink: */
 struct coda_readlink_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 struct coda_readlink_out {
@@ -589,7 +590,7 @@ struct coda_readlink_out {
 /* coda_fsync: NO_OUT */
 struct coda_fsync_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 struct coda_fsync_out {
@@ -599,18 +600,18 @@ struct coda_fsync_out {
 /* coda_inactive: NO_OUT */
 struct coda_inactive_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 /* coda_vget: */
 struct coda_vget_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 struct coda_vget_out {
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
     int        vtype;
 };
 
@@ -626,7 +627,7 @@ struct coda_purgeuser_out {
 #ifdef CODA_COMPAT_5
     struct coda_cred cred;
 #else
-    uid_t uid;
+    cuid_t uid;
 #endif
 };
 
@@ -634,14 +635,14 @@ struct coda_purgeuser_out {
 /* CODA_ZAPFILE is a venus->kernel call */
 struct coda_zapfile_out {  
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 /* coda_zapdir: */
 /* CODA_ZAPDIR is a venus->kernel call */      
 struct coda_zapdir_out {         
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 /* coda_zapnode: */
@@ -651,41 +652,44 @@ struct coda_zapvnode_out { 
 #ifdef CODA_COMPAT_5
     struct coda_cred cred;
 #endif
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 /* coda_purgefid: */
 /* CODA_PURGEFID is a venus->kernel call */    
 struct coda_purgefid_out { 
     struct coda_out_hdr oh;
-    CodaFid Fid;
+    struct CodaFid Fid;
 };
 
 /* 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;
-    CodaFid NewFid;
-    CodaFid OldFid;
+    struct CodaFid NewFid;
+    struct CodaFid OldFid;
 };
 
 /* coda_open_by_fd: */
 struct coda_open_by_fd_in {
     struct coda_in_hdr ih;
-    CodaFid Fid;
+    struct CodaFid Fid;
     int        flags;
 };
 
 struct coda_open_by_fd_out {
     struct coda_out_hdr oh;
     int fd;
+#ifdef _KERNEL
+    /* not passed from userspace but used in-kernel only */
     struct vnode *vp;
+#endif
 };
 
 /* coda_open_by_path: */
 struct coda_open_by_path_in {
     struct coda_in_hdr ih;
-    CodaFid    Fid;
+    struct CodaFid     Fid;
     int        flags;
 };
 
@@ -799,6 +803,9 @@ struct PioctlData {
 
 #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"
 
@@ -810,10 +817,9 @@ struct PioctlData {
 #define INVAL_FID              { 0, 0, 0 }
 #else
 #define        CTL_FID                 { { -1, -1, -1, -1 } }
-#define        IS_CTL_FID(fidp)        ((fidp)->opaque[0] == -1 &&\
-                                (fidp)->opaque[1] == -1 &&\
-                                (fidp)->opaque[2] == -1 &&\
-                                (fidp)->opaque[3] == -1)
+#define        IS_CTL_FID(fidp)        ((fidp)->opaque[1] == CTL_VOL && \
+                               (fidp)->opaque[2] == CTL_VNO && \
+                               (fidp)->opaque[3] == CTL_UNI)
 #define        INVAL_FID               { { 0, 0, 0, 0 } }
 #endif
 

Modified: head/sys/fs/coda/coda_subr.c
==============================================================================
--- head/sys/fs/coda/coda_subr.c        Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_subr.c        Mon Apr  5 20:12:54 2010        
(r206210)
@@ -164,7 +164,7 @@ coda_unsave(struct cnode *cp)
  * NOTE: this allows multiple cnodes with same fid -- dcs 1/25/95
  */
 struct cnode *
-coda_find(CodaFid *fid)
+coda_find(struct CodaFid *fid)
 {
        struct cnode *cp;
 

Modified: head/sys/fs/coda/coda_subr.h
==============================================================================
--- head/sys/fs/coda/coda_subr.h        Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_subr.h        Mon Apr  5 20:12:54 2010        
(r206210)
@@ -35,7 +35,7 @@
 
 struct cnode   *coda_alloc(void);
 void            coda_free(struct cnode *cp);
-struct cnode   *coda_find(CodaFid *fid);
+struct cnode   *coda_find(struct CodaFid *fid);
 void            coda_flush(struct coda_mntinfo *mnt, enum dc_status dcstat);
 void            coda_testflush(void);
 void            coda_checkunmounting(struct mount *mp);

Modified: head/sys/fs/coda/coda_venus.c
==============================================================================
--- head/sys/fs/coda/coda_venus.c       Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_venus.c       Mon Apr  5 20:12:54 2010        
(r206210)
@@ -177,7 +177,7 @@ int coda_kernel_version = CODA_KERNEL_VE
 
 int
 venus_root(void *mdp, struct ucred *cred, struct proc *p,
-    /*out*/ CodaFid *VFid)
+    /*out*/ struct CodaFid *VFid)
 {
        DECL_NO_IN(coda_root);          /* sets Isize & Osize */
        ALLOC_NO_IN(coda_root);         /* sets inp & outp */
@@ -194,7 +194,7 @@ venus_root(void *mdp, struct ucred *cred
 }
 
 int
-venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred,
+venus_open(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred,
     struct proc *p, /*out*/ struct vnode **vp)
 {
        int cflag;
@@ -215,7 +215,7 @@ venus_open(void *mdp, CodaFid *fid, int 
 }
 
 int
-venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred,
+venus_close(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred,
     struct proc *p)
 {
        int cflag;
@@ -252,7 +252,7 @@ venus_write(void)
  * normal files.
  */
 int
-venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data,
+venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag, caddr_t data,
     struct ucred *cred, struct proc *p)
 {
        DECL(coda_ioctl);                       /* sets Isize & Osize */
@@ -304,7 +304,8 @@ venus_ioctl(void *mdp, CodaFid *fid, int
 }
 
 int
-venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct vattr *vap)
+venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred,
+    struct vattr *vap)
 {
        struct proc *p;
        DECL(coda_getattr);                     /* sets Isize & Osize */
@@ -326,7 +327,8 @@ venus_getattr(void *mdp, CodaFid *fid, s
 }
 
 int
-venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred)
+venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap,
+    struct ucred *cred)
 {
        struct proc *p;
        DECL_NO_OUT(coda_setattr);              /* sets Isize & Osize */
@@ -347,8 +349,8 @@ venus_setattr(void *mdp, CodaFid *fid, s
 }
 
 int
-venus_access(void *mdp, CodaFid *fid, accmode_t accmode, struct ucred *cred,
-    struct proc *p)
+venus_access(void *mdp, struct CodaFid *fid, accmode_t accmode,
+    struct ucred *cred, struct proc *p)
 {
        DECL_NO_OUT(coda_access);               /* sets Isize & Osize */
        ALLOC_NO_OUT(coda_access);              /* sets inp & outp */
@@ -374,8 +376,8 @@ venus_access(void *mdp, CodaFid *fid, ac
 }
 
 int
-venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p,
-    /*out*/ char **str, int *len)
+venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred,
+    struct proc *p, /*out*/ char **str, int *len)
 {
        DECL(coda_readlink);                    /* sets Isize & Osize */
        coda_readlink_size += CODA_MAXPATHLEN;
@@ -400,7 +402,7 @@ venus_readlink(void *mdp, CodaFid *fid, 
 }
 
 int
-venus_fsync(void *mdp, CodaFid *fid, struct proc *p)
+venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p)
 {
        DECL_NO_OUT(coda_fsync);                /* sets Isize & Osize */
        ALLOC_NO_OUT(coda_fsync);               /* sets inp & outp */
@@ -420,8 +422,9 @@ venus_fsync(void *mdp, CodaFid *fid, str
 }
 
 int
-venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len,
-    struct ucred *cred, struct proc *p, /*out*/        CodaFid *VFid, int 
*vtype)
+venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len,
+    struct ucred *cred, struct proc *p, /*out*/        struct CodaFid *VFid,
+    int *vtype)
 {
        DECL(coda_lookup);                      /* sets Isize & Osize */
        coda_lookup_size += len + 1;
@@ -457,9 +460,9 @@ venus_lookup(void *mdp, CodaFid *fid, co
 }
 
 int
-venus_create(void *mdp, CodaFid *fid, const char *nm, int len, int exclusive,
-    int mode, struct vattr *va, struct ucred *cred, struct proc *p,
-    /*out*/ CodaFid *VFid, struct vattr *attr)
+venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len,
+    int exclusive, int mode, struct vattr *va, struct ucred *cred,
+    struct proc *p, /*out*/ struct CodaFid *VFid, struct vattr *attr)
 {
        DECL(coda_create);                      /* sets Isize & Osize */
        coda_create_size += len + 1;
@@ -488,7 +491,7 @@ venus_create(void *mdp, CodaFid *fid, co
 }
 
 int
-venus_remove(void *mdp, CodaFid *fid, const char *nm, int len,
+venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len,
     struct ucred *cred, struct proc *p)
 {
        DECL_NO_OUT(coda_remove);               /* sets Isize & Osize */
@@ -511,8 +514,8 @@ venus_remove(void *mdp, CodaFid *fid, co
 }
 
 int
-venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len,
-    struct ucred *cred, struct proc *p)
+venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid,
+    const char *nm, int len, struct ucred *cred, struct proc *p)
 {
        DECL_NO_OUT(coda_link);         /* sets Isize & Osize */
        coda_link_size += len + 1;
@@ -535,8 +538,9 @@ venus_link(void *mdp, CodaFid *fid, Coda
 }
 
 int
-venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len,
-    const char *tnm, int tlen, struct ucred *cred, struct proc *p)
+venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid,
+    const char *nm, int len, const char *tnm, int tlen, struct ucred *cred,
+    struct proc *p)
 {
        DECL_NO_OUT(coda_rename);               /* sets Isize & Osize */
        coda_rename_size += len + 1 + tlen + 1;
@@ -562,9 +566,9 @@ venus_rename(void *mdp, CodaFid *fid, Co
 }
 
 int
-venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len,
+venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len,
     struct vattr *va, struct ucred *cred, struct proc *p,
-    /*out*/ CodaFid *VFid, struct vattr *ova)
+    /*out*/ struct CodaFid *VFid, struct vattr *ova)
 {
        DECL(coda_mkdir);                       /* sets Isize & Osize */
        coda_mkdir_size += len + 1;
@@ -591,7 +595,7 @@ venus_mkdir(void *mdp, CodaFid *fid, con
 }
 
 int
-venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len,
+venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len,
     struct ucred *cred, struct proc *p)
 {
        DECL_NO_OUT(coda_rmdir);                /* sets Isize & Osize */
@@ -614,7 +618,7 @@ venus_rmdir(void *mdp, CodaFid *fid, con
 }
 
 int
-venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen,
+venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm, int llen,
     const char *nm, int len, struct vattr *va, struct ucred *cred,
     struct proc *p)
 {
@@ -645,7 +649,7 @@ venus_symlink(void *mdp, CodaFid *fid, c
  * XXX: Unused.
  */
 int
-venus_readdir(void *mdp, CodaFid *fid, int count, int offset,
+venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset,
     struct ucred *cred, struct proc *p, /*out*/        char *buffer, int *len)
 {
        DECL(coda_readdir);                     /* sets Isize & Osize */
@@ -672,8 +676,8 @@ venus_readdir(void *mdp, CodaFid *fid, i
 }
 
 int
-venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p,
-    /*out*/ CodaFid *VFid, int *vtype)
+venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred,
+    struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype)
 {
        DECL(coda_vget);                        /* sets Isize & Osize */
        ALLOC(coda_vget);                       /* sets inp & outp */

Modified: head/sys/fs/coda/coda_venus.h
==============================================================================
--- head/sys/fs/coda/coda_venus.h       Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_venus.h       Mon Apr  5 20:12:54 2010        
(r206210)
@@ -34,49 +34,50 @@
 #define        _CODA_VENUS_H_
 
 int    venus_root(void *mdp, struct ucred *cred, struct proc *p,
-           /*out*/ CodaFid *VFid);
-int    venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred,
-           struct proc *p, /*out*/ struct vnode **vp);
-int    venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred,
-           struct proc *p);
+           /*out*/ struct CodaFid *VFid);
+int    venus_open(void *mdp, struct CodaFid *fid, int flag,
+           struct ucred *cred, struct proc *p, /*out*/ struct vnode **vp);
+int    venus_close(void *mdp, struct CodaFid *fid, int flag,
+           struct ucred *cred, struct proc *p);
 void   venus_read(void);
 void   venus_write(void);
-int    venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data,
-           struct ucred *cred, struct proc *p);
-int    venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred,
+int    venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag,
+           caddr_t data, struct ucred *cred, struct proc *p);
+int    venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred,
            struct vattr *vap);
-int    venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap,
+int    venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap,
            struct ucred *cred);
-int    venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred,
-           struct proc *p);
-int    venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred,
+int    venus_access(void *mdp, struct CodaFid *fid, int mode,
+           struct ucred *cred, struct proc *p);
+int    venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred,
            struct proc *p, /*out*/ char **str, int *len);
-int    venus_fsync(void *mdp, CodaFid *fid, struct proc *p);
-int    venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len,
-           struct ucred *cred, struct proc *p, /*out*/ CodaFid *VFid,
+int    venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p);
+int    venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len,
+           struct ucred *cred, struct proc *p, /*out*/ struct CodaFid *VFid,
            int *vtype);
-int    venus_create(void *mdp, CodaFid *fid, const char *nm, int len,
+int    venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len,
            int exclusive, int mode, struct vattr *va, struct ucred *cred,
-           struct proc *p, /*out*/ CodaFid *VFid, struct vattr *attr);
-int    venus_remove(void *mdp, CodaFid *fid, const char *nm, int len,
+           struct proc *p, /*out*/ struct CodaFid *VFid,
+           struct vattr *attr);
+int    venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len,
            struct ucred *cred, struct proc *p);
-int    venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm,
-           int len, struct ucred *cred, struct proc *p);
-int    venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm,
-           int len, const char *tnm, int tlen, struct ucred *cred,
-           struct proc *p);
-int    venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len,
+int    venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid,
+           const char *nm, int len, struct ucred *cred, struct proc *p);
+int    venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid,
+           const char *nm, int len, const char *tnm, int tlen,
+           struct ucred *cred, struct proc *p);
+int    venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len,
            struct vattr *va, struct ucred *cred, struct proc *p,
-           /*out*/ CodaFid *VFid, struct vattr *ova);
-int    venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len,
+           /*out*/ struct CodaFid *VFid, struct vattr *ova);
+int    venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len,
+           struct ucred *cred, struct proc *p);
+int    venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm,
+           int llen, const char *nm, int len, struct vattr *va,
            struct ucred *cred, struct proc *p);
-int    venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen,
-           const char *nm, int len, struct vattr *va, struct ucred *cred,
-           struct proc *p);
-int    venus_readdir(void *mdp, CodaFid *fid, int count, int offset,
+int    venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset,
            struct ucred *cred, struct proc *p, /*out*/ char *buffer,
            int *len);
-int    venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred,
-           struct proc *p, /*out*/ CodaFid *VFid, int *vtype);
+int    venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred,
+           struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype);
 
 #endif /* !_CODA_VENUS_H_ */

Modified: head/sys/fs/coda/coda_vfsops.c
==============================================================================
--- head/sys/fs/coda/coda_vfsops.c      Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_vfsops.c      Mon Apr  5 20:12:54 2010        
(r206210)
@@ -113,8 +113,8 @@ coda_mount(struct mount *vfsp)
        struct cdev *dev;
        struct coda_mntinfo *mi;
        struct vnode *rootvp;
-       CodaFid rootfid = INVAL_FID;
-       CodaFid ctlfid = CTL_FID;
+       struct CodaFid rootfid = INVAL_FID;
+       struct CodaFid ctlfid = CTL_FID;
        int error;
        struct nameidata ndp;
        ENTRY;
@@ -268,8 +268,8 @@ coda_root(struct mount *vfsp, int flags,
        int error;
        struct proc *p;
        struct thread *td;
-       CodaFid VFid;
-       static const CodaFid invalfid = INVAL_FID;
+       struct CodaFid VFid;
+       static const struct CodaFid invalfid = INVAL_FID;
 
        td = curthread;
        p = td->td_proc;
@@ -288,7 +288,7 @@ coda_root(struct mount *vfsp, int flags,
                 * but not in any released versions as of 6 Mar 2003.
                 */
                if (memcmp(&VTOC(mi->mi_rootvp)->c_fid, &invalfid,
-                   sizeof(CodaFid)) != 0 || mi->mi_started == 0) {
+                   sizeof(struct CodaFid)) != 0 || mi->mi_started == 0) {
                        /*
                         * Found valid root.
                         */
@@ -407,7 +407,7 @@ coda_fhtovp(struct mount *vfsp, struct f
        int error;
        struct thread *td = curthread; /* XXX -mach */
        struct proc *p = td->td_proc;
-       CodaFid VFid;
+       struct CodaFid VFid;
        int vtype;
 
        ENTRY;

Modified: head/sys/fs/coda/coda_vfsops.h
==============================================================================
--- head/sys/fs/coda/coda_vfsops.h      Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_vfsops.h      Mon Apr  5 20:12:54 2010        
(r206210)
@@ -42,7 +42,7 @@
 struct cfid {
        u_short cfid_len;
        u_short padding;
-       CodaFid cfid_fid;
+       struct CodaFid  cfid_fid;
 };
 
 struct mbuf;

Modified: head/sys/fs/coda/coda_vnops.c
==============================================================================
--- head/sys/fs/coda/coda_vnops.c       Mon Apr  5 20:01:21 2010        
(r206209)
+++ head/sys/fs/coda/coda_vnops.c       Mon Apr  5 20:12:54 2010        
(r206210)
@@ -872,7 +872,7 @@ coda_lookup(struct vop_cachedlookup_args
        struct cnode *cp;
        const char *nm = cnp->cn_nameptr;
        int len = cnp->cn_namelen;
-       CodaFid VFid;
+       struct CodaFid VFid;
        int vtype;
        int error = 0;
 
@@ -1009,7 +1009,7 @@ coda_create(struct vop_create_args *ap)
        struct cnode *cp;
        const char *nm = cnp->cn_nameptr;
        int len = cnp->cn_namelen;
-       CodaFid VFid;
+       struct CodaFid VFid;
        struct vattr attr;
 
        MARK_ENTRY(CODA_CREATE_STATS);
@@ -1278,7 +1278,7 @@ coda_mkdir(struct vop_mkdir_args *ap)
        const char *nm = cnp->cn_nameptr;
        int len = cnp->cn_namelen;
        struct cnode *cp;
-       CodaFid VFid;
+       struct CodaFid VFid;
        struct vattr ova;
 
        MARK_ENTRY(CODA_MKDIR_STATS);
@@ -1687,7 +1687,7 @@ coda_print_cred(struct ucred *cred)
  * coda_unsave.
  */
 struct cnode *
-make_coda_node(CodaFid *fid, struct mount *vfsp, short type)
+make_coda_node(struct CodaFid *fid, struct mount *vfsp, short type)
 {
        struct cnode *cp;
        struct vnode *vp;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to