diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 51a934f..81a84bb 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 - * $Id: ufs_readwrite.c,v 1.59 1999/07/08 06:06:00 mckusick Exp $ + * $Id: ufs_readwrite.c,v 1.60 1999/07/13 18:20:12 mckusick Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -70,7 +70,7 @@ READ(ap) ufs_daddr_t lbn, nextlbn; off_t bytesinfile; long size, xfersize, blkoffset; - int error; + int error, orig_resid; u_short mode; int seqcount; int ioflag; @@ -97,10 +97,16 @@ READ(ap) if ((u_int64_t)uio->uio_offset > fs->fs_maxfilesize) return (EFBIG); + orig_resid = uio->uio_resid; + if (orig_resid <= 0) + return (0); + object = vp->v_object; bytesinfile = ip->i_size - uio->uio_offset; if (bytesinfile <= 0) { + if ((vp->v_mount->mnt_flag & MNT_NOATIME) == 0) + ip->i_flag |= IN_ACCESS; return 0; } @@ -131,7 +137,9 @@ READ(ap) * If we finished or there was an error * then finish up. */ - if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) + if ((error == 0 || + uio->uio_resid != orig_resid) && + (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) ip->i_flag |= IN_ACCESS; if (object) /* @@ -170,7 +178,10 @@ READ(ap) if (toread >= PAGE_SIZE) { error = uioread(toread, uio, object, &nread); if ((uio->uio_resid == 0) || (error != 0)) { - if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) + if ((error == 0 || + uio->uio_resid != orig_resid) && + (vp->v_mount->mnt_flag & + MNT_NOATIME) == 0) ip->i_flag |= IN_ACCESS; if (object) vm_object_vndeallocate(object); @@ -343,7 +354,8 @@ READ(ap) if (object) vm_object_vndeallocate(object); - if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) + if ((error == 0 || uio->uio_resid != orig_resid) && + (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) ip->i_flag |= IN_ACCESS; return (error); } |