afs: Return raw code from background daemons
[openafs.git] / src / afs / IRIX / osi_vnodeops.c
index b594526..c55474a 100644 (file)
@@ -52,7 +52,7 @@ extern void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b);
 
 extern int afs_fid2();
 
-static int afsrwvp(register struct vcache *avc, register struct uio *uio,
+static int afsrwvp(struct vcache *avc, struct uio *uio,
                   enum uio_rw rw, int ioflag,
 #ifdef AFS_SGI64_ENV
                   struct cred *cr, struct flid *flp);
@@ -341,7 +341,7 @@ static int acchk = 0;
 static int acdrop = 0;
 
 static int
-afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw,
+afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw,
        int ioflag,
 #ifdef AFS_SGI64_ENV
        struct cred *cr, struct flid *flp)
@@ -349,7 +349,7 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw,
        struct cred *cr)
 #endif
 {
-    register struct vnode *vp = AFSTOV(avc);
+    struct vnode *vp = AFSTOV(avc);
     struct buf *bp;
     daddr_t bn;
     off_t acnt, cnt;
@@ -846,7 +846,7 @@ OSI_VC_DECL(avc);
 
     if (bp->b_flags & B_READ) {
        uio->uio_fmode = FREAD;
-       error = afs_read(vp, uio, cr, 0, 0, 0);
+       error = afs_read(vp, uio, cr, 0);
     } else {
        uio->uio_fmode = FWRITE;
        error = afs_write(vp, uio, 0, cr, 0);
@@ -927,7 +927,7 @@ OSI_VC_DECL(avc);
 {
     OSI_VC_CONVERT(avc);
     struct vnode *vp = AFSTOV(avc);
-    register struct brequest *tb;
+    struct brequest *tb;
     struct vrequest treq;
     afs_int32 code;
 
@@ -976,13 +976,13 @@ OSI_VC_DECL(avc);
            /* at least one daemon is idle, so ask it to do the store.
             * Also, note that  we don't lock it any more... */
            tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred,
-                           (afs_size_t) acred->cr_uid, 0L, (void *)0);
+                           (afs_size_t) afs_cr_uid(acred), 0L, (void *)0,
+                           (void *)0, (void *)0);
            /* sleep waiting for the store to start, then retrieve error code */
            while ((tb->flags & BUVALID) == 0) {
                tb->flags |= BUWAIT;
                afs_osi_Sleep(tb);
            }
-           code = tb->code;
            afs_BRelease(tb);
        }
     } else {
@@ -1886,58 +1886,22 @@ struct vnodeops *afs_ops = &Afs_vnodeops;
 #endif /* MP */
 
 
-#if defined(AFS_SGI62_ENV) && defined(AFS_SGI_DUAL_FS_CACHE)
-/* Support for EFS and XFS caches. The assumption here is that the size of
+/* Support for XFS caches. The assumption here is that the size of
  * a cache file also does not exceed 32 bits. 
  */
 
 /* Initialized in osi_InitCacheFSType(). Used to determine inode type. */
-int afs_CacheFSType = -1;
-vnodeops_t *afs_efs_vnodeopsp;
 vnodeops_t *afs_xfs_vnodeopsp;
-vnode_t *(*afs_IGetVnode) (ino_t);
-
-extern vnode_t *afs_EFSIGetVnode(ino_t);       /* defined in osi_file.c */
-extern vnode_t *afs_XFSIGetVnode(ino_t);       /* defined in osi_file.c */
 
 extern afs_lock_t afs_xosi;    /* lock is for tvattr */
 
-/* Initialize the cache operations. Called while initializing cache files. */
-void
-afs_InitDualFSCacheOps(struct vnode *vp)
-{
-    static int inited = 0;
-    struct vfssw *swp;
-    int found = 0;
-
-    if (inited)
-       return;
-    inited = 1;
-
-    swp = vfs_getvfssw("xfs");
-    if (swp) {
-       afs_xfs_vnodeopsp = swp->vsw_vnodeops;
-       if (!found) {
-           if (vp && vp->v_op == afs_xfs_vnodeopsp) {
-               afs_CacheFSType = AFS_SGI_XFS_CACHE;
-               afs_IGetVnode = afs_XFSIGetVnode;
-               found = 1;
-           }
-       }
-    }
-
-    if (vp && !found)
-       osi_Panic("osi_InitCacheFSType: Can't find fstype for vnode 0x%llx\n",
-                 vp);
-}
-
 ino_t
 VnodeToIno(vnode_t * vp)
 {
     int code;
     struct vattr vattr;
 
-    MObtainWriteLock(&afs_xosi, 579);
+    ObtainWriteLock(&afs_xosi, 579);
     vattr.va_mask = AT_FSID | AT_NODEID;       /* quick return using this mask. */
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1945,7 +1909,7 @@ VnodeToIno(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToIno");
     }
-    MReleaseWriteLock(&afs_xosi);
+    ReleaseWriteLock(&afs_xosi);
     return vattr.va_nodeid;
 }
 
@@ -1955,7 +1919,7 @@ VnodeToDev(vnode_t * vp)
     int code;
     struct vattr vattr;
 
-    MObtainWriteLock(&afs_xosi, 580);
+    ObtainWriteLock(&afs_xosi, 580);
     vattr.va_mask = AT_FSID | AT_NODEID;       /* quick return using this mask. */
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1963,7 +1927,7 @@ VnodeToDev(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToDev");
     }
-    MReleaseWriteLock(&afs_xosi);
+    ReleaseWriteLock(&afs_xosi);
     return (dev_t) vattr.va_fsid;
 }
 
@@ -1973,7 +1937,7 @@ VnodeToSize(vnode_t * vp)
     int code;
     struct vattr vattr;
 
-    MObtainWriteLock(&afs_xosi, 581);
+    ObtainWriteLock(&afs_xosi, 581);
     vattr.va_mask = AT_SIZE;
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1981,8 +1945,7 @@ VnodeToSize(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToSize");
     }
-    MReleaseWriteLock(&afs_xosi);
+    ReleaseWriteLock(&afs_xosi);
     return vattr.va_size;
 }
-#endif /* 6.2 and dual fs cache */
 #endif /* AFS_SGI62_ENV */