diff options
author | kib <kib@FreeBSD.org> | 2007-02-08 09:47:19 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-02-08 09:47:19 +0000 |
commit | 08a6b49351509c52787a1d71ac0176a74f136b08 (patch) | |
tree | d78a25ec4bbd223970ea17c456fc0673e6b7e468 /sys/ufs | |
parent | 64e5ae3e30d0bb2d9cdd02df0032f22d366f13ad (diff) | |
download | FreeBSD-src-08a6b49351509c52787a1d71ac0176a74f136b08.zip FreeBSD-src-08a6b49351509c52787a1d71ac0176a74f136b08.tar.gz |
Remove not needed acquision of the mount interlock aroung reading of
mnt_kern_flags in ufs_itimes().
Suggested by: ssouhlal
Confirmed by: tegge
MFC after: 2 weeks
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 86b5b84..3c74f79 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -133,19 +133,15 @@ ufs_itimes(vp) { struct inode *ip; struct timespec ts; - int mnt_locked; ip = VTOI(vp); - mnt_locked = 0; - if ((vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { - VI_LOCK(vp); + VI_LOCK(vp); + if ((vp->v_mount->mnt_flag & MNT_RDONLY) != 0) goto out; + if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) == 0) { + VI_UNLOCK(vp); + return; } - MNT_ILOCK(vp->v_mount); /* For reading of mnt_kern_flags. */ - mnt_locked = 1; - VI_LOCK(vp); - if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) == 0) - goto out_unl; if ((vp->v_type == VBLK || vp->v_type == VCHR) && !DOINGSOFTDEP(vp)) ip->i_flag |= IN_LAZYMOD; @@ -172,10 +168,7 @@ ufs_itimes(vp) out: ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); - out_unl: VI_UNLOCK(vp); - if (mnt_locked) - MNT_IUNLOCK(vp->v_mount); } /* |