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

View file

@ -75,6 +75,7 @@ struct devsw md_dev = {
.dv_ioctl = noioctl,
.dv_print = md_print,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
static int

View file

@ -53,6 +53,7 @@ struct devsw vdisk_dev = {
.dv_ioctl = vdisk_ioctl,
.dv_print = vdisk_print,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t;

View file

@ -103,6 +103,7 @@ struct devsw efipart_hddev = {
.dv_ioctl = efipart_ioctl,
.dv_print = efipart_printhd,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
static pdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo);

View file

@ -190,6 +190,7 @@ struct devsw bioshd = {
.dv_ioctl = bd_ioctl,
.dv_print = bd_print,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
static bdinfo_list_t *

View file

@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h>
#include "bootstrap.h"
#include "host_syscall.h"
#include "disk.h"
static int hostdisk_init(void);
static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk,
@ -49,6 +50,7 @@ struct devsw hostdisk = {
.dv_ioctl = hostdisk_ioctl,
.dv_print = hostdisk_print,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
static int

View file

@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <stand.h>
#include <sys/disk.h>
#include "bootstrap.h"
#include "disk.h"
#include "libofw.h"
static int ofwd_init(void);
@ -60,6 +60,7 @@ struct devsw ofwdisk = {
.dv_ioctl = ofwd_ioctl,
.dv_print = ofwd_print,
.dv_cleanup = nullsys,
.dv_fmtdev = disk_fmtdev,
};
/*

View file

@ -62,6 +62,7 @@ static struct devsw geli_devsw = {
.dv_ioctl = geli_dev_ioctl,
.dv_print = geli_dev_print,
.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;
/* 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)
return;

View file

@ -90,6 +90,7 @@ struct devsw uboot_storage = {
.dv_ioctl = stor_ioctl,
.dv_print = stor_print,
.dv_cleanup = stor_cleanup,
.dv_fmtdev = disk_fmtdev,
};
static int

View file

@ -61,6 +61,7 @@ struct devsw umass_disk = {
.dv_ioctl = umass_disk_ioctl,
.dv_print = umass_disk_print,
.dv_cleanup = umass_disk_cleanup,
.dv_fmtdev = disk_fmtdev,
};
static int

View file

@ -72,6 +72,7 @@ struct devsw userboot_disk = {
.dv_ioctl = userdisk_ioctl,
.dv_print = userdisk_print,
.dv_cleanup = userdisk_cleanup,
.dv_fmtdev = disk_fmtdev,
};
/*