git: 0b3a4a588fb6 - main - stand: Use devformat instead of disk_devfmt

From: Warner Losh <imp_at_FreeBSD.org>
Date: Thu, 11 Aug 2022 16:27:44 UTC
The branch main has been updated by imp:

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

commit 0b3a4a588fb6b30d923686828dab4685b94ec1ea
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-08-11 15:07:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-08-11 16:27:16 +0000

    stand: Use devformat instead of disk_devfmt
    
    Use devformat instead of disk_devfmt. This allows us to avoid knowing
    the details of the device that's underneath us. Remove disk.h include
    and the -I${LDRSRC} from the build of ufs.c since they are no longer
    needed.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D35922
---
 stand/libsa/Makefile | 1 -
 stand/libsa/ufs.c    | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
index c2372e192b38..dc35fe007506 100644
--- a/stand/libsa/Makefile
+++ b/stand/libsa/Makefile
@@ -170,7 +170,6 @@ SRCS+=	time.c
 .PATH: ${SRCTOP}/sys/ufs/ffs
 SRCS+=ffs_subr.c ffs_tables.c
 
-CFLAGS.ufs.c+= -I${LDRSRC}
 CFLAGS.gzipfs.c+= ${ZLIB_CFLAGS}
 CFLAGS.pkgfs.c+= ${ZLIB_CFLAGS}
 CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2  -DBZ_NO_STDIO -DBZ_NO_COMPRESS
diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c
index de3dbe58789b..ef7cb07e75da 100644
--- a/stand/libsa/ufs.c
+++ b/stand/libsa/ufs.c
@@ -81,7 +81,6 @@ __FBSDID("$FreeBSD$");
 #include <ufs/ufs/dir.h>
 #include <ufs/ffs/fs.h>
 #include "stand.h"
-#include "disk.h"
 #include "string.h"
 
 static int	ufs_open(const char *path, struct open_file *f);
@@ -520,7 +519,7 @@ ufs_open(const char *upath, struct open_file *f)
 		return (errno);
 	f->f_fsdata = (void *)fp;
 
-	dev = disk_fmtdev(f->f_devdata);
+	dev = devformat((struct devdesc *)f->f_devdata);
 	/* Is this device mounted? */
 	STAILQ_FOREACH(mnt, &mnt_list, um_link) {
 		if (strcmp(dev, mnt->um_dev) == 0)
@@ -739,7 +738,7 @@ ufs_close(struct open_file *f)
 	}
 	free(fp->f_buf);
 
-	dev = disk_fmtdev(f->f_devdata);
+	dev = devformat((struct devdesc *)f->f_devdata);
 	STAILQ_FOREACH(mnt, &mnt_list, um_link) {
 		if (strcmp(dev, mnt->um_dev) == 0)
 			break;