afs: Properly type afs_osi_suser cred arg
[openafs.git] / src / afs / AIX / osi_misc.c
index bb3b99e..be4336a 100644 (file)
@@ -19,7 +19,6 @@
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID("$Header$");
 
 #include "h/systm.h"
 #include "h/types.h"
@@ -37,7 +36,6 @@ RCSID("$Header$");
 #include "osi_vfs.h"
 #include "netinet/in.h"
 #include "h/mbuf.h"
-#include "rpc/types.h"
 #include "rpc/xdr.h"
 #include "h/vmuser.h"
 #include "h/syspest.h"
@@ -57,7 +55,7 @@ RCSID("$Header$");
  * initialization of all gfs; one day we might need to actual do somehing here.
  */
 Afs_init(gfsp)
-char   *gfsp;  /* this is really struct gfs *, but we do not use it */
+     char *gfsp;               /* this is really struct gfs *, but we do not use it */
 {
     extern int afs_gn_strategy();
 #define AFS_VM_BUFS 50
@@ -65,7 +63,7 @@ char  *gfsp;  /* this is really struct gfs *, but we do not use it */
     /* For now nothing special is required during AFS initialization. */
     AFS_STATCNT(afs_init);
 
-    (void) vm_mount(D_REMOTE, afs_gn_strategy, AFS_VM_BUFS);
+    (void)vm_mount(D_REMOTE, afs_gn_strategy, AFS_VM_BUFS);
     return 0;
 }
 
@@ -82,17 +80,24 @@ char        *gfsp;  /* this is really struct gfs *, but we do not use it */
  */
 int
 gop_rdwr(rw, vp, base, len, offset, segflg, unit, aresid)
-enum uio_rw    rw;
-struct vnode   *vp;
-caddr_t                base;
-off_t          *offset;
-int            len, segflg;
-int            *aresid;
-int            unit;       /* Ignored */
+     enum uio_rw rw;
+     struct vnode *vp;
+     caddr_t base;
+#ifdef AFS_64BIT_KERNEL
+     offset_t *offset;
+#else
+     off_t *offset;
+#endif
+     int len, segflg;
+     int *aresid;
+     int unit;                 /* Ignored */
 {
-    struct uio uio_struct;
+    struct uio uio_struct;
     struct iovec uiovector;
-    register int code;
+    int code;
+
+    memset(&uio_struct, 0, sizeof(uio_struct));
+    memset(&uiovector, 0, sizeof(uiovector));
 
     AFS_STATCNT(gop_rdwr);
     /* Set up the uio structure */
@@ -106,8 +111,16 @@ int                unit;       /* Ignored */
     uio_struct.uio_resid = len;
     uio_struct.uio_fmode = (rw == UIO_READ ? FREAD : FWRITE);
 
-    code = VNOP_RDWR(vp, rw, (rw == UIO_READ ? FREAD : FWRITE), &uio_struct,
-                    NULL, NULL, NULL, &afs_osi_cred);
+#ifdef AFS_64BIT_KERNEL
+    code =
+       VNOP_RDWR(vp, rw, (int32long64_t) (rw == UIO_READ ? FREAD : FWRITE),
+                 &uio_struct, (ext_t) 0, (caddr_t) 0, (struct vattr *)0,
+                 &afs_osi_cred);
+#else
+    code =
+       VNOP_RDWR(vp, rw, (rw == UIO_READ ? FREAD : FWRITE), &uio_struct,
+                 NULL, NULL, NULL, &afs_osi_cred);
+#endif
     *aresid = uio_struct.uio_resid;
     return code;
 }
@@ -124,10 +137,10 @@ int               unit;       /* Ignored */
  * no linked list of gnodes to remove this element from.
  */
 aix_gnode_rele(vp)
-struct vnode *vp;
+     struct vnode *vp;
 {
-    register struct vnode *tvp;
-    register struct vfs *vfsp = vp->v_vfsp;
+    struct vnode *tvp;
+    struct vfs *vfsp = vp->v_vfsp;
 
     /* Unlink the vnode from the list the vfs has hanging of it */
     tvp = vfsp->vfs_vnodes;
@@ -138,12 +151,12 @@ struct vnode *vp;
     if (vp->v_vfsprev != NULL)
        vp->v_vfsprev->v_vfsnext = vp->v_vfsnext;
 
-    endgnode:
-      /* Free the allocated gnode that was accompanying the vcache's vnode */
-      if (vp->v_gnode) {
-         osi_FreeSmallSpace(vp->v_gnode);
-         vp->v_gnode = 0;
-      }
+  endgnode:
+    /* Free the allocated gnode that was accompanying the vcache's vnode */
+    if (vp->v_gnode) {
+       osi_FreeSmallSpace(vp->v_gnode);
+       vp->v_gnode = 0;
+    }
 
     return 0;
 }
@@ -154,11 +167,11 @@ struct vnode *vp;
  * Note that it must NOT set errno.
  */
 
-afs_suser() {
-    register rc;
+afs_suser(afs_ucred_t *credp)
+{
+    int rc;
     char err;
-    
+
     rc = suser(&err);
     return rc;
 }
-