Remove support for Solaris pre-8
[openafs.git] / src / afs / SOLARIS / osi_inode.c
index d352e32..42c3541 100644 (file)
@@ -16,8 +16,6 @@
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID
-    ("$Header$");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -38,14 +36,14 @@ extern int (*ufs_iallocp) (), (*ufs_iupdatp) (), (*ufs_igetp) (),
 
 getinode(vfsp, dev, inode, ipp, credp, perror)
      struct vfs *vfsp;
-     struct AFS_UCRED *credp;
+     afs_ucred_t *credp;
      struct inode **ipp;
      dev_t dev;
      ino_t inode;
      int *perror;
 {
     struct inode *ip;
-    register afs_int32 code;
+    afs_int32 code;
     struct vnode *vp;
     struct fs *fs;
     struct inode *pip;
@@ -55,13 +53,7 @@ getinode(vfsp, dev, inode, ipp, credp, perror)
 
     *perror = 0;
 
-    if (!vfsp
-#if !defined(AFS_SUN58_ENV)
-       && !(vfsp = vfs_devsearch(dev))
-#else
-       && !(vfsp = vfs_dev2vfsp(dev))
-#endif
-       ) {
+    if (!vfsp && !(vfsp = vfs_dev2vfsp(dev))) {
        return (ENODEV);
     }
     ufsvfsp = (struct ufsvfs *)vfsp->vfs_data;
@@ -84,7 +76,7 @@ getinode(vfsp, dev, inode, ipp, credp, perror)
 
 /* get an existing inode.  Common code for iopen, iread/write, iinc/dec. */
 igetinode(vfsp, dev, inode, ipp, credp, perror)
-     struct AFS_UCRED *credp;
+     afs_ucred_t *credp;
      struct inode **ipp;
      struct vfs *vfsp;
      dev_t dev;
@@ -93,7 +85,7 @@ igetinode(vfsp, dev, inode, ipp, credp, perror)
 {
     struct inode *pip, *ip;
     extern struct osi_dev cacheDev;
-    register int code = 0;
+    int code = 0;
 
     *perror = 0;
 
@@ -132,7 +124,7 @@ igetinode(vfsp, dev, inode, ipp, credp, perror)
 #ifdef AFS_SUN510_ENV
        dnlc_enter(ITOV(ip), "a", ITOV(ip));
 #else
-       dnlc_enter(ITOV(ip), "a", ITOV(ip), (struct AFS_UCRED *)0);
+       dnlc_enter(ITOV(ip), "a", ITOV(ip), (afs_ucred_t *)0);
 #endif
     }
 
@@ -146,13 +138,13 @@ int CrSync = 1;
 afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp,
                    credp)
      rval_t *rvp;
-     struct AFS_UCRED *credp;
+     afs_ucred_t *credp;
      long near_inode, param1, param2, param3, param4;
      dev_t dev;
 {
     int dummy, err = 0;
     struct inode *ip, *newip;
-    register int code;
+    int code;
     dev_t newdev;
     struct ufsvfs *ufsvfsp;
 
@@ -165,7 +157,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp,
       * This conversion is needed only for the 64 bit OS.
       */
 
-#ifdef AFS_SUN57_64BIT_ENV
+#ifdef AFS_SUN5_64BIT_ENV
     newdev = expldev((dev32_t) dev);
 #else
     newdev = dev;
@@ -197,12 +189,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp,
     rw_enter(&newip->i_contents, RW_WRITER);
     newip->i_flag |= IACC | IUPD | ICHG;
 
-#if    defined(AFS_SUN56_ENV)
     newip->i_vicemagic = VICEMAGIC;
-#else
-    newip->i_uid = 0;
-    newip->i_gid = -2;
-#endif
     newip->i_nlink = 1;
     newip->i_mode = IFREG;
 #ifdef AFS_SUN510_ENV
@@ -221,7 +208,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp,
            (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff);
        newip->i_vicep3 = ((param4 << 16) + (param2 & 0xffff));
     }
-#ifdef AFS_SUN57_64BIT_ENV
+#ifdef AFS_SUN5_64BIT_ENV
     rvp->r_vals = newip->i_number;
 #else
     rvp->r_val1 = newip->i_number;
@@ -240,7 +227,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp,
 
 afs_syscall_iopen(dev, inode, usrmod, rvp, credp)
      rval_t *rvp;
-     struct AFS_UCRED *credp;
+     afs_ucred_t *credp;
      int inode, usrmod;
      dev_t dev;
 {
@@ -249,7 +236,7 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp)
     struct vnode *vp = NULL;
     int dummy;
     int fd;
-    register int code;
+    int code;
     dev_t newdev;
 
     AFS_STATCNT(afs_syscall_iopen);
@@ -261,7 +248,7 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp)
       * This conversion is needed only for the 64 bit OS.
       */
 
-#ifdef AFS_SUN57_64BIT_ENV
+#ifdef AFS_SUN5_64BIT_ENV
     newdev = expldev((dev32_t) dev);
 #else
     newdev = dev;
@@ -297,7 +284,13 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp)
      * XXX We should set the fp to null since we don't need it in the icalls
      */
     setf(fd, fp);
-#ifdef AFS_SUN57_64BIT_ENV
+
+    /* rvp->r_val{1,2} are really members into a union and are re-extracted
+     * later by solaris. If we're not 64-bit, they appear to just be the same
+     * thing, but on 64-bit they point to two different 32-bit locations that
+     * make up one 64-bit int; so on 64-bit big-endian we need to set the
+     * second one. */
+#if defined(AFS_SUN5_64BIT_ENV) && !defined(AFSLITTLE_ENDIAN)
     rvp->r_val2 = fd;
 #else
     rvp->r_val1 = fd;
@@ -310,13 +303,13 @@ int IncSync = 1;
 
 afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp)
      rval_t *rvp;
-     struct AFS_UCRED *credp;
+     afs_ucred_t *credp;
      int inode, inode_p1, amount;
      dev_t dev;
 {
     int dummy;
     struct inode *ip;
-    register afs_int32 code;
+    afs_int32 code;
     dev_t newdev;
 
     if (!afs_osi_suser(credp))
@@ -326,7 +319,7 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp)
       * This conversion is needed only for the 64 bit OS.
       */
 
-#ifdef AFS_SUN57_64BIT_ENV
+#ifdef AFS_SUN5_64BIT_ENV
     newdev = expldev((dev32_t) dev);
 #else
     newdev = dev;