git: 67dc1e7b0457 - main - msdosfs deextend(): memoize DETOV(dep)

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 13 Feb 2023 22:31:41 UTC
The branch main has been updated by kib:

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

commit 67dc1e7b0457ec014a1291c5874decdefe7bffdd
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-02-11 18:05:14 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-02-13 22:29:32 +0000

    msdosfs deextend(): memoize DETOV(dep)
    
    Reviewed by:    markj
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D38549
---
 sys/fs/msdosfs/msdosfs_denode.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index 6c38481681de..0b4135d60784 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -496,13 +496,14 @@ int
 deextend(struct denode *dep, u_long length, struct ucred *cred)
 {
 	struct msdosfsmount *pmp = dep->de_pmp;
+	struct vnode *vp = DETOV(dep);
 	u_long count;
 	int error;
 
 	/*
 	 * The root of a DOS filesystem cannot be extended.
 	 */
-	if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp))
+	if ((vp->v_vflag & VV_ROOT) != 0 && !FAT32(pmp))
 		return (EINVAL);
 
 	/*
@@ -528,10 +529,10 @@ deextend(struct denode *dep, u_long length, struct ucred *cred)
 			return (error);
 		}
 	}
-	vnode_pager_setsize(DETOV(dep), length);
+	vnode_pager_setsize(vp, length);
 	dep->de_FileSize = length;
 	dep->de_flag |= DE_UPDATE | DE_MODIFIED;
-	return (deupdat(dep, !DOINGASYNC(DETOV(dep))));
+	return (deupdat(dep, !DOINGASYNC(vp)));
 }
 
 /*