Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2022 12:43:01 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1c7084fe5612 - main - vfs: clean up parse_mount_dev_present
Message-ID:  <202209171243.28HCh1Nl053513@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg:

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

commit 1c7084fe5612f179517994becb24a4d8f7a23cbe
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-17 12:42:46 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-17 12:42:46 +0000

    vfs: clean up parse_mount_dev_present
---
 sys/kern/vfs_mountroot.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index ac0cec44f802..5361f41276a0 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -718,19 +718,19 @@ parse_directive(char **conf)
 	return (error);
 }
 
-static int
+static bool
 parse_mount_dev_present(const char *dev)
 {
 	struct nameidata nd;
 	int error;
 
-	NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, dev);
+	NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, dev);
 	error = namei(&nd);
-	if (!error) {
-		vput(nd.ni_vp);
-		NDFREE_PNBUF(&nd);
-	}
-	return (error != 0) ? 0 : 1;
+	if (error != 0)
+		return (false);
+	vrele(nd.ni_vp);
+	NDFREE_PNBUF(&nd);
+	return (true);
 }
 
 #define	ERRMSGL	255



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209171243.28HCh1Nl053513>