From nobody Tue Jan 24 22:13:18 2023 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 4P1h7M2HT8z3bgTt; Tue, 24 Jan 2023 22:13:19 +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 4P1h7M0gxdz3GbQ; Tue, 24 Jan 2023 22:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598399; 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=bB9HhcDpsqLGXt+3xeBFBP88uG7QXWtOSYuHzctBKkY=; b=raBzwtbzHO4BafrIESJVzWikHQeloez0RmO0t9KWxl8jKI3dllKzXd7BnzsBPPC5ZzvZI4 H3NYFx7R6EYebvhyik72VFBDUaQQXAFijiJNiGnFDn2WdV4xOs83FNEqKiSEZ7qGCpEav0 5+Kqjs5M1G3bnljQoj1YAMvFpeDh+mYKaaDLXY1xkWEXq+kf8MDrRewHm2GJ3cieMdmg+y ACxdMk7ZwfSQYzVjSxLzW422fS4toxowvw6TyodSyehBYNcG4xUhIdq3DEsc+ZsDMd+ZI1 HjuKdUjeZEyJOrpKyHHnEjzb+tNRuOCvKwBk4Nq5w5f1srAdQ43bAdL4QgCgoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598399; 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=bB9HhcDpsqLGXt+3xeBFBP88uG7QXWtOSYuHzctBKkY=; b=hRMxzSlZlapyto/ojt9zD4NlXduzuxe8FHXiQwLmriNoxxZygcAnwNpvDOvCBJVgcelHEh tb7tzkdx5M3sxzdOZfuAYsX0zigNCXePERV2HVX02xrTUjAJRTugETbdgAkRMOy1nTn/MW 4fTenzH+yeorqyZARxWN1Jm9ID44C7wzxFl8xN7rqpbO1QOT8FcuNqgw7FHFI5IBPUF59v Qvj6Rh0sdPh8otXRCJ+guLZWvBtTE1oB2QfR4ehQzNUwf82EXm6ZRBOWw6XlkhJBPAcggR 7ZllBQigV+L4xSfgVoOnS0bXbkgh22q9WJ41b67qdhBoiimKbsi4B1aILGTYDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598399; a=rsa-sha256; cv=none; b=y1BzbWR77Lq90g33SS1yTNj2FwpTcVHe525AvcPsc64xVYH3Bu4hyDpqm78PUgHugPTWFk lDiMll/yAh+wjS4iluIzyNCs06/9TkrtkAtK2hexcjDiJppSuleCgjirKs28cbQGQoCJNS jLsVSGoOTX6Qx4PAUqw8bPQXkY9luxE1Wol5Ey976IxOluGGIRG2yhMFqDdkxDeNXaYTqy g9ZJsGfKC8PGFtRlunhOnQ0eZXZJiNq6aKWnE1Dn1CxDUJTlgRwhb0+XgVPilrKmV0qDYP EuapOWWLwfP9Tixi76HsWHGPKb0gSEuX2l+nLU8L5+N3WHNTRTnTArDhBzXkUw== 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 4P1h7L6j3YzQk3; Tue, 24 Jan 2023 22:13:18 +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 30OMDI5a088250; Tue, 24 Jan 2023 22:13:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMDIbM088249; Tue, 24 Jan 2023 22:13:18 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:13:18 GMT Message-Id: <202301242213.30OMDIbM088249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 69814700c6fb - stable/13 - stand/ofw: Access the parsing routine more directly 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 69814700c6fb327d9ea616572934806fc9b7a3ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=69814700c6fb327d9ea616572934806fc9b7a3ca commit 69814700c6fb327d9ea616572934806fc9b7a3ca Author: Warner Losh AuthorDate: 2022-11-30 22:09:09 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:39 +0000 stand/ofw: Access the parsing routine more directly We don't need to check if something is a ZFS device. Instead, if the found device has a parse routine, call it. Otherwise, just copy the path. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37343 (cherry picked from commit d16083815caf32dd117487c709b33669cef4af6f) --- stand/libofw/devicename.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c index 292fba927d1a..f03703e3872f 100644 --- a/stand/libofw/devicename.c +++ b/stand/libofw/devicename.c @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" -#include "libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -109,15 +108,16 @@ found: printf("ofw_parsedev: malloc failed\n"); return ENOMEM; } - strcpy(idev->d_path, name); idev->dd.d_dev = dv; - if (dv->dv_type == DEVT_ZFS) { + if (dv->dv_parsedev != NULL) { p = devspec + strlen(dv->dv_name); free(idev); - err = zfs_parsedev((struct devdesc **)&idev, p, path); + err = dv->dv_parsedev((struct devdesc **)&idev, p, path); if (err != 0) { return (err); } + } else { + strcpy(idev->d_path, name); } if (dev == NULL) {