aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2022-09-12 23:20:59 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2023-08-24 23:30:34 +0000
commit60457d1ea0680dfec0efa80832339a7b4fa96160 (patch)
tree67bad10240b920ddf3a032e19c9b223853916bdc
parentca63cbbe95540bfcac3f6020ded5b5ed6522c6a2 (diff)
downloadsrc-60457d1ea0680dfec0efa80832339a7b4fa96160.tar.gz
src-60457d1ea0680dfec0efa80832339a7b4fa96160.zip
ufs: try to elide the interlock in ufs_itimes
Reviewed by: kib, mckusick Differential Revision: https://reviews.freebsd.org/D36522 (cherry picked from commit 04f095a49165cf4903fda0f21271be5c6bfa5857)
-rw-r--r--sys/ufs/ufs/ufs_vnops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 8eeb3ac84f6b..a6ca523ae87c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -188,6 +188,11 @@ ufs_itimes_locked(struct vnode *vp)
void
ufs_itimes(struct vnode *vp)
{
+ struct inode *ip;
+
+ ip = VTOI(vp);
+ if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) == 0)
+ return;
VI_LOCK(vp);
ufs_itimes_locked(vp);