git: 31784ee1e37d - main - kern___realpathat(): style

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 25 Nov 2024 19:36:47 UTC
The branch main has been updated by kib:

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

commit 31784ee1e37dc0337637493721c4c9b98547089b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-25 12:41:17 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-25 19:36:41 +0000

    kern___realpathat(): style
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Differential revision:  https://reviews.freebsd.org/D47739
---
 sys/kern/vfs_cache.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index fa6b23fe3d6f..c4b4d59f3b40 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -3265,6 +3265,8 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
 
 	if (nd.ni_vp->v_type == VREG && nd.ni_dvp->v_type != VDIR &&
 	    (nd.ni_vp->v_vflag & VV_ROOT) != 0) {
+		struct vnode *covered_vp;
+
 		/*
 		 * This happens if vp is a file mount. The call to
 		 * vn_fullpath_hardlink can panic if path resolution can't be
@@ -3274,7 +3276,6 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
 		 * this should have a unique global path since we disallow
 		 * mounting on linked files.
 		 */
-		struct vnode *covered_vp;
 		error = vn_lock(nd.ni_vp, LK_SHARED);
 		if (error != 0)
 			goto out;
@@ -3284,8 +3285,9 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
 		error = vn_fullpath(covered_vp, &retbuf, &freebuf);
 		vrele(covered_vp);
 	} else {
-		error = vn_fullpath_hardlink(nd.ni_vp, nd.ni_dvp, nd.ni_cnd.cn_nameptr,
-		    nd.ni_cnd.cn_namelen, &retbuf, &freebuf, &size);
+		error = vn_fullpath_hardlink(nd.ni_vp, nd.ni_dvp,
+		    nd.ni_cnd.cn_nameptr, nd.ni_cnd.cn_namelen, &retbuf,
+		    &freebuf, &size);
 	}
 	if (error == 0) {
 		error = copyout(retbuf, buf, size);