stand: Add disk_fmtdev for dv_fmtdev for all the disk devices

All of the archsw fmtdev functions treat DEVT_DISK as a call to
disk_fmtdev. Set all disks' dv_fmtdev to disk_fmtdev so devformat
will return the same thing.

Sponsored by:		Netflix
Reviewed by:		tsoome (prior version)
Differential Revision:	https://reviews.freebsd.org/D35917
This commit is contained in:
Warner Losh
2022-08-11 09:06:28 -06:00
parent dc472f6702
commit ad759c7352
10 changed files with 13 additions and 2 deletions
+1
View File
@@ -75,6 +75,7 @@ struct devsw md_dev = {
.dv_ioctl = noioctl, .dv_ioctl = noioctl,
.dv_print = md_print, .dv_print = md_print,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
static int static int
+1
View File
@@ -53,6 +53,7 @@ struct devsw vdisk_dev = {
.dv_ioctl = vdisk_ioctl, .dv_ioctl = vdisk_ioctl,
.dv_print = vdisk_print, .dv_print = vdisk_print,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t; typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t;
+1
View File
@@ -103,6 +103,7 @@ struct devsw efipart_hddev = {
.dv_ioctl = efipart_ioctl, .dv_ioctl = efipart_ioctl,
.dv_print = efipart_printhd, .dv_print = efipart_printhd,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
static pdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo); static pdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo);
+1
View File
@@ -190,6 +190,7 @@ struct devsw bioshd = {
.dv_ioctl = bd_ioctl, .dv_ioctl = bd_ioctl,
.dv_print = bd_print, .dv_print = bd_print,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
static bdinfo_list_t * static bdinfo_list_t *
+2
View File
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h> #include <stdarg.h>
#include "bootstrap.h" #include "bootstrap.h"
#include "host_syscall.h" #include "host_syscall.h"
#include "disk.h"
static int hostdisk_init(void); static int hostdisk_init(void);
static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk,
@@ -49,6 +50,7 @@ struct devsw hostdisk = {
.dv_ioctl = hostdisk_ioctl, .dv_ioctl = hostdisk_ioctl,
.dv_print = hostdisk_print, .dv_print = hostdisk_print,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
static int static int
+2 -1
View File
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <stand.h> #include <stand.h>
#include <sys/disk.h> #include <sys/disk.h>
#include "bootstrap.h" #include "disk.h"
#include "libofw.h" #include "libofw.h"
static int ofwd_init(void); static int ofwd_init(void);
@@ -60,6 +60,7 @@ struct devsw ofwdisk = {
.dv_ioctl = ofwd_ioctl, .dv_ioctl = ofwd_ioctl,
.dv_print = ofwd_print, .dv_print = ofwd_print,
.dv_cleanup = nullsys, .dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
}; };
/* /*
+2 -1
View File
@@ -62,6 +62,7 @@ static struct devsw geli_devsw = {
.dv_ioctl = geli_dev_ioctl, .dv_ioctl = geli_dev_ioctl,
.dv_print = geli_dev_print, .dv_print = geli_dev_print,
.dv_cleanup = geli_dev_cleanup, .dv_cleanup = geli_dev_cleanup,
.dv_fmtdev = disk_fmtdev,
}; };
/* /*
@@ -305,7 +306,7 @@ geli_probe_and_attach(struct open_file *f)
hlastblk = (hmediasize / DEV_BSIZE) - 1; hlastblk = (hmediasize / DEV_BSIZE) - 1;
/* Taste the host provider. If it's not geli-encrypted just return. */ /* Taste the host provider. If it's not geli-encrypted just return. */
gdev = geli_taste(diskdev_read, hdesc, hlastblk, disk_fmtdev(&hdesc->dd)); gdev = geli_taste(diskdev_read, hdesc, hlastblk, devformat(&hdesc->dd));
if (gdev == NULL) if (gdev == NULL)
return; return;
+1
View File
@@ -90,6 +90,7 @@ struct devsw uboot_storage = {
.dv_ioctl = stor_ioctl, .dv_ioctl = stor_ioctl,
.dv_print = stor_print, .dv_print = stor_print,
.dv_cleanup = stor_cleanup, .dv_cleanup = stor_cleanup,
.dv_fmtdev = disk_fmtdev,
}; };
static int static int
+1
View File
@@ -61,6 +61,7 @@ struct devsw umass_disk = {
.dv_ioctl = umass_disk_ioctl, .dv_ioctl = umass_disk_ioctl,
.dv_print = umass_disk_print, .dv_print = umass_disk_print,
.dv_cleanup = umass_disk_cleanup, .dv_cleanup = umass_disk_cleanup,
.dv_fmtdev = disk_fmtdev,
}; };
static int static int
+1
View File
@@ -72,6 +72,7 @@ struct devsw userboot_disk = {
.dv_ioctl = userdisk_ioctl, .dv_ioctl = userdisk_ioctl,
.dv_print = userdisk_print, .dv_print = userdisk_print,
.dv_cleanup = userdisk_cleanup, .dv_cleanup = userdisk_cleanup,
.dv_fmtdev = disk_fmtdev,
}; };
/* /*