afs: Avoid using logical OR when setting f_fsid
[openafs.git] / src / afs / SOLARIS / osi_vfsops.c
index 88ab992..1f03b8f 100644 (file)
@@ -121,7 +121,7 @@ afs_unmount(struct vfs *afsp, int flag, afs_ucred_t *credp)
         * besides the caller of afs_unmount */
        rootvp = afs_globalVp;
        afs_globalVp = NULL;
-       AFS_RELE(rootvp);
+       AFS_RELE(AFSTOV(rootvp));
     }
 
     AFS_GUNLOCK();
@@ -178,7 +178,7 @@ again:
 
        if (!(code = afs_InitReq(&treq, proc->p_cred))
            && !(code = afs_CheckInit())) {
-           tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
+           tvp = afs_GetVCache(&afs_rootFid, &treq);
            /* we really want this to stay around */
            if (tvp) {
                if (afs_globalVp) {
@@ -189,11 +189,11 @@ again:
                }
                afs_globalVp = tvp;
            } else
-               code = ENOENT;
+               code = EIO;
        }
     }
     if (tvp) {
-       AFS_FAST_HOLD(tvp);
+       osi_Assert(osi_vnhold(tvp) == 0);
        mutex_enter(&AFSTOV(tvp)->v_lock);
        AFSTOV(tvp)->v_flag |= VROOT;
        mutex_exit(&AFSTOV(tvp)->v_lock);
@@ -229,7 +229,7 @@ afs_statvfs(struct vfs *afsp, struct statvfs64 *abp)
     abp->f_bsize = afsp->vfs_bsize;
     abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
        abp->f_favail = abp->f_ffree = AFS_VFS_FAKEFREE;
-    abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
+    abp->f_fsid = (AFS_VFSMAGIC << 16) | AFS_VFSFSID;
 
     AFS_GUNLOCK();
     return 0;
@@ -254,7 +254,11 @@ afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp)
 
     *avcp = NULL;
     if (!(code = afs_InitReq(&treq, credp))) {
-       code = afs_osi_vget((struct vcache **)avcp, fidp, &treq);
+        struct vcache *tvc = NULL;
+       code = afs_osi_vget(&tvc, fidp, &treq);
+        if (tvc) {
+            *avcp = AFSTOV(tvc);
+        }
     }
 
     afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp,
@@ -483,14 +487,6 @@ static struct sysent afssysent = {
 };
 #endif /* AFS_SUN511_ENV */
 
-/* inter-module dependencies */
-char _depends_on[] = 
-#if AFS_SUN510_ENV
-       "drv/ip drv/udp strmod/rpcmod fs/ufs";
-#else
-       "drv/ip drv/udp strmod/rpcmod";
-#endif
-
 /*
  * Info/Structs to link the afs module into the kernel
  */