Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2022 22:31:20 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d16083815caf - main - stand/ofw: Access the parsing routine more directly
Message-ID:  <202211302231.2AUMVKqY023479@gitrepo.freebsd.org>

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

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

commit d16083815caf32dd117487c709b33669cef4af6f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-11-30 22:09:09 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-11-30 22:30:32 +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
---
 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) {



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