git: e9db6f25b5a6 - stable/13 - stand: Replace zfs_fmtdev with generic devformat()

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:12:02 UTC
The branch stable/13 has been updated by imp:

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

commit e9db6f25b5a6bb9ca76351c88720cca2ffcb6604
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-08-11 15:07:44 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:31 +0000

    stand: Replace zfs_fmtdev with generic devformat()
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D35973
    
    (cherry picked from commit edb26097cb6416adb89b54c830d36c0ead3ca64c)
---
 stand/i386/loader/main.c       | 2 +-
 stand/i386/zfsboot/zfsboot.c   | 4 ++--
 stand/libsa/zfs/zfs.c          | 2 +-
 stand/userboot/userboot/main.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c
index 4d5a0a98a08e..c15c97c961b7 100644
--- a/stand/i386/loader/main.c
+++ b/stand/i386/loader/main.c
@@ -387,7 +387,7 @@ extract_currdev(void)
 
 #ifdef LOADER_ZFS_SUPPORT
 	if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS)
-		init_zfs_boot_options(zfs_fmtdev(&new_currdev.dd));
+		init_zfs_boot_options(devformat(&new_currdev.dd));
 #endif
 
 	env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c
index 52fd41688a17..930a6fb530af 100644
--- a/stand/i386/zfsboot/zfsboot.c
+++ b/stand/i386/zfsboot/zfsboot.c
@@ -222,11 +222,11 @@ main(void)
 	    devdesc.d_partition >= 0 ? devdesc.d_partition : 0xff);
 
 	/*
-	 * zfs_fmtdev() can be called only after dv_init
+	 * devformat() can be called only after dv_init
 	 */
 	if (bdev != NULL && bdev->dd.d_dev->dv_type == DEVT_ZFS) {
 		/* set up proper device name string for ZFS */
-		strncpy(boot_devname, zfs_fmtdev(&bdev->dd), sizeof (boot_devname));
+		strncpy(boot_devname, devformat(&bdev->dd), sizeof (boot_devname));
 		if (zfs_get_bootonce(bdev, OS_BOOTONCE, cmd,
 		    sizeof(cmd)) == 0) {
 			nvlist_t *benv;
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 0ac67d750fcd..b525858ffc3c 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -1583,7 +1583,7 @@ zfs_dev_open(struct open_file *f, ...)
 	rv = 0;
 	/* This device is not set as currdev, mount us private copy. */
 	if (mount == NULL)
-		rv = zfs_mount(zfs_fmtdev(&dev->dd), NULL, (void **)&mount);
+		rv = zfs_mount(devformat(&dev->dd), NULL, (void **)&mount);
 
 	if (rv == 0) {
 		f->f_devdata = mount;
diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
index d3f12ab1675e..d323d1f9789b 100644
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -260,7 +260,7 @@ extract_currdev(void)
 		bzero(&zdev, sizeof(zdev));
 		zdev.dd.d_dev = &zfs_dev;
 		
-		init_zfs_boot_options(zfs_fmtdev(&zdev.dd));
+		init_zfs_boot_options(devformat(&zdev.dd));
 		dd = &zdev.dd;
 	} else
 #endif