afs_size_t finalOffset;
off_t toffset;
int mixed = 0;
+ afs_size_t add2resid = 0;
#endif /* AFS_64BIT_CLIENT */
register struct vcache *vcp = VTOAFS(vp);
struct dcache *tdc;
#ifdef AFS_64BIT_CLIENT
if (xfrOffset + xfrSize > afs_vmMappingEnd) {
+ if (rw == UIO_READ) {
+ /* don't read past EOF */
+ if (xfrSize+xfrOffset > fileSize) {
+ add2resid = xfrSize + xfrOffset - fileSize;
+ xfrSize = fileSize - xfrOffset;
+ if (xfrSize <= 0) goto fail;
+ txfrSize = xfrSize;
+ afsio_trim(uiop, txfrSize);
+ }
+ }
if (xfrOffset < afs_vmMappingEnd) {
/* special case of a buffer crossing the VM mapping line */
struct uio tuio;
} else {
ReleaseReadLock(&vcp->lock);
code = afs_direct_rdwr(vp, uiop, rw, ioflag, credp);
+ uiop->uio_resid += add2resid;
return code;
}
}
if (mixed) {
uiop->afsio_offset = finalOffset;
}
+ uiop->uio_resid += add2resid;
#endif /* AFS_64BIT_CLIENT */
return code;
}