From 0b3a4a588fb6b30d923686828dab4685b94ec1ea Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 11 Aug 2022 09:07:13 -0600 Subject: [PATCH] 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 #include #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;