From nobody Sat Sep 17 12:43:01 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MV9Zs2TYMz4chgx; Sat, 17 Sep 2022 12:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MV9Zs1yLsz45jZ; Sat, 17 Sep 2022 12:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663418581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3W8Q1v+yi/xBzU9fEFTVc2wgBLVzw71pA+A0E2ET/S4=; b=Qnvg6KL35W9rMIncQW7hI4YibIzJWjFjjPeX3sCBdevb4wGJZSh5rJVFsJtiSkqj8kDwDe mfWJA8AcX/FpGX0xSKpVu2EZCbaN0Gb7ABWxqDrkJ8DSMV3ZWRp0axBu7xLxoXQiYE/9la r0G+fferHJjvt40iDFv7gazQJ+8YiKWuD0cA841aWlgYTcwZCND4Ktv8feZ5d1bg5TmFyw RBnpYlDf2J3ViVbFnK2yDqgbv6HflmmHDlVZC6geTyyDw6PrzyWKqwQzNxNrEnr8fy580I UHinyEnjBFw8tR6NEvuMKK4XqmGx9EU6zsieF+UJoBnTGX58Q9+7hrh8JGvS/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MV9Zs0zg5zjLH; Sat, 17 Sep 2022 12:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28HCh1qo053514; Sat, 17 Sep 2022 12:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28HCh1Nl053513; Sat, 17 Sep 2022 12:43:01 GMT (envelope-from git) Date: Sat, 17 Sep 2022 12:43:01 GMT Message-Id: <202209171243.28HCh1Nl053513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 1c7084fe5612 - main - vfs: clean up parse_mount_dev_present List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c7084fe5612f179517994becb24a4d8f7a23cbe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663418581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3W8Q1v+yi/xBzU9fEFTVc2wgBLVzw71pA+A0E2ET/S4=; b=fW2sd8hx1IYS5WYhB+bzoV10VM2I3Njhuw9dxU9/mFlFTnaHFzatqYimGQs8+3IaLgBWGq ZtkVvXhPPzBqDpIa6EVQ61NIFV/6ARq+nd0BJsFgFuPR2upi3Hi+6sZ5qW3H8FrICQ1CWJ mBUcJZX2KMwljcQo/1W14roU/l/kPMPOyr2RNQUOgJQjCqAPIP7TgkPEvHMVbN1DJ1Zi8N 1hRtQSMMWISoSlUn5INBKyR9BxpkKL6YrdQviVEOkFt+5GNNNP3F9R/tf99Og4RpuYbRjN RmOumOCTeMpRmciOH4/yfFwblmEecyjeCWrKv5q18VuiKr2NLsCkqtPtBi242w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663418581; a=rsa-sha256; cv=none; b=G+7jKlujU6AsKgys/qTXtUg0aRckzX+DUha2NBjQ+NI6qbAystsHXL6NRbhlbpj3x4+yAF uYXxJBG5In64gA038by9oa773Q9EB4rmjeqo1kz2ETjAZ+/kWODj5kFeIdoyTXKcEF40lO mSYK0ubWZIVVN6epwrD6c44BwZkbIRIvrJkbXxBmK6n3gSDEeecvuQ4PV29wIuf1poX1jN CvaL/n32AT7TJ/y/syNvKXQnq2oKbsGfjnQl2Uo+c4zQGZz1Yxx8CN6lP/HIjtVRtv8r2x jzE/waNHwOh6RvfduGYxDt9vBe+GtujwTb5UZfQfAVUE0TliT0toN+XngaDOsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7084fe5612f179517994becb24a4d8f7a23cbe commit 1c7084fe5612f179517994becb24a4d8f7a23cbe Author: Mateusz Guzik AuthorDate: 2022-09-17 12:42:46 +0000 Commit: Mateusz Guzik 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