git: ab6a6a092834 - stable/14 - kern___realpathat(): style

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 28 Nov 2024 13:30:14 UTC
The branch stable/14 has been updated by kib:

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

commit ab6a6a092834e7b3a74e1b05d3006ca2d91a7188
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-25 12:41:17 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-28 12:53:17 +0000

    kern___realpathat(): style
    
    (cherry picked from commit 31784ee1e37dc0337637493721c4c9b98547089b)
---
 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 9ec0970628b4..d48c1c0be80a 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -3178,6 +3178,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
@@ -3187,7 +3189,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;
@@ -3197,8 +3198,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);