ReleaseReadLock(&avc->lock);
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1);
ObtainReadLock(&avc->lock);
- ObtainReadLock(&tdc->lock);
+ if (tdc) ObtainReadLock(&tdc->lock);
}
}
*/
if (tdc) {
ReleaseReadLock(&tdc->lock);
-#ifndef AFS_VM_RDWR_ENV
+#if !defined(AFS_VM_RDWR_ENV)
/* try to queue prefetch, if needed */
if (!noLock) {
afs_PrefetchChunk(avc, tdc, acred, &treq);
VOP_UNLOCK(tfile->vnode, 0, current_proc());
AFS_GLOCK();
#else
+#if defined(AFS_FBSD_ENV)
+ AFS_GUNLOCK();
+ VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
+ code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
+ VOP_UNLOCK(tfile->vnode, 0, curproc);
+ AFS_GLOCK();
+#else
code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
#endif
#endif
#endif
#endif
#endif
+#endif
auio->afsio_offset += avc->quick.minLoc;
osi_UFSClose(tfile);
/* Fix up LRU info */
if (!noLock) {
ReleaseReadLock(&avc->lock);
-#ifndef AFS_VM_RDWR_ENV
+#if !defined(AFS_VM_RDWR_ENV)
if (!(code = afs_InitReq(&treq, acred))) {
if (!(tdc->mflags & DFNextStarted))
afs_PrefetchChunk(avc, tdc, acred, &treq);
struct vrequest treq;
AFS_STATCNT(afs_UFSRead);
- if (avc->vc_error)
+ if (avc && avc->vc_error)
return EIO;
/* check that we have the latest status info in the vnode cache */
ReleaseReadLock(&avc->lock);
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1);
ObtainReadLock(&avc->lock);
- ObtainReadLock(&tdc->lock);
+ if (tdc) ObtainReadLock(&tdc->lock);
}
}
VOP_UNLOCK(tfile->vnode, 0, current_proc());
AFS_GLOCK();
#else
+#if defined(AFS_FBSD_ENV)
+ AFS_GUNLOCK();
+ VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
+ code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
+ VOP_UNLOCK(tfile->vnode, 0, curproc);
+ AFS_GLOCK();
+#else
code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
#endif
#endif
#endif
#endif
#endif
+#endif
#ifdef IHINT
if (!tdc->ihint && nihints < maxIHint) {
*/
if (tdc) {
ReleaseReadLock(&tdc->lock);
-#ifndef AFS_VM_RDWR_ENV
+#if !defined(AFS_VM_RDWR_ENV)
/* try to queue prefetch, if needed */
if (!noLock) {
if (!(tdc->mflags & DFNextStarted))