git: be931de6c99f - main - ufs: always call ufs_itimes on close

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Wed, 14 Sep 2022 18:12:21 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=be931de6c99f346cedb7a364602f1cb654a32caf

commit be931de6c99f346cedb7a364602f1cb654a32caf
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-12 23:19:42 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-14 18:11:40 +0000

    ufs: always call ufs_itimes on close
    
    While here dedup code with fifo.
    
    Reviewed by:    kib, mckusick
    Differential Revision:  https://reviews.freebsd.org/D36522
---
 sys/ufs/ufs/ufs_vnops.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 0c4f2f9941b1..9f1fe0409483 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -354,13 +354,8 @@ ufs_close(
 	} */ *ap)
 {
 	struct vnode *vp = ap->a_vp;
-	int usecount;
 
-	VI_LOCK(vp);
-	usecount = vp->v_usecount;
-	if (usecount > 1)
-		ufs_itimes_locked(vp);
-	VI_UNLOCK(vp);
+	ufs_itimes(vp);
 	return (0);
 }
 
@@ -2640,14 +2635,8 @@ ufsfifo_close(
 		struct thread *a_td;
 	} */ *ap)
 {
-	struct vnode *vp = ap->a_vp;
-	int usecount;
 
-	VI_LOCK(vp);
-	usecount = vp->v_usecount;
-	if (usecount > 1)
-		ufs_itimes_locked(vp);
-	VI_UNLOCK(vp);
+	ufs_close(ap);
 	return (fifo_specops.vop_close(ap));
 }