diff options
author | kib <kib@FreeBSD.org> | 2008-03-21 12:33:00 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-03-21 12:33:00 +0000 |
commit | 04661caa35742f4595c6d0c3cf9846a3f8b5e888 (patch) | |
tree | 78f7cc2f6fd779f94d5ad2ae8dd99df1f4d66b4a /sys | |
parent | 2030a16c64e44fd47b40eb5eeebd6e357652fab1 (diff) | |
download | FreeBSD-src-04661caa35742f4595c6d0c3cf9846a3f8b5e888.zip FreeBSD-src-04661caa35742f4595c6d0c3cf9846a3f8b5e888.tar.gz |
Reduce the acquisition of the vnode interlock in the ffs_read() and
ffs_extread() when setting the IN_ACCESS flag by checking whether the
IN_ACCESS is already set. The possible race there is admissible.
Tested by: pho
Submitted by: jeff
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 334308a..7968662 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -605,7 +605,8 @@ ffs_read(ap) } if ((error == 0 || uio->uio_resid != orig_resid) && - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) { + (vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && + (ip->i_flag & IN_ACCESS) == 0) { VI_LOCK(vp); ip->i_flag |= IN_ACCESS; VI_UNLOCK(vp); @@ -1006,7 +1007,8 @@ ffs_extread(struct vnode *vp, struct uio *uio, int ioflag) } if ((error == 0 || uio->uio_resid != orig_resid) && - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0) { + (vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && + (ip->i_flag & IN_ACCESS) == 0) { VI_LOCK(vp); ip->i_flag |= IN_ACCESS; VI_UNLOCK(vp); |