afs: Remove afs_xosi
[openafs.git] / src / afs / HPUX / osi_file.c
index 59c2594..bd52756 100644 (file)
@@ -19,7 +19,6 @@
 
 int afs_osicred_initialized = 0;
 afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfs *afs_cacheVfsp;
 
@@ -37,12 +36,12 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
        osi_Panic("UFSOpen called for non-UFS cache\n");
     }
     if (!afs_osicred_initialized) {
-       /* valid for alpha_osf, SunOS, Ultrix */
+       /* valid for SunOS, Ultrix */
        memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     setuerror(0);
     AFS_GUNLOCK();
     ip = (struct inode *)igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev,
@@ -66,7 +65,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
     code = VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, VSYNC);
     AFS_GLOCK();
@@ -75,7 +73,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -107,7 +104,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     VATTR_NULL(&tvattr);
     /* note that this credential swapping stuff is only necessary because
      * of ufs's references directly to u.u_cred instead of to
@@ -119,7 +115,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, 0);
     AFS_GLOCK();
     set_p_cred(u.u_procp, oldCred);    /* restore */
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -147,7 +142,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
       * down. No point in crashing when we are already shutting down
       */
     if (!afile) {
-       if (!afs_shuttingdown)
+       if (afs_shuttingdown == AFS_RUNNING)
            osi_Panic("osi_Read called with null param");
        else
            return -EIO;
@@ -178,7 +173,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        }
        setuerror(code);
        if (code > 0) {
-           code *= -1;
+           code = -code;
        }
     }
     return code;
@@ -211,7 +206,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
                ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
        setuerror(code);
        if (code > 0) {
-           code *= -1;
+           code = -code;
        }
     }
     if (afile->proc) {