Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | vdev_geom_io(struct g_consumer *cp, int *cmds, void **datas, off_t *offsets, | ||||
off_t *sizes, int *errors, int ncmds) | off_t *sizes, int *errors, int ncmds) | ||||
{ | { | ||||
struct bio **bios; | struct bio **bios; | ||||
uint8_t *p; | uint8_t *p; | ||||
off_t off, maxio, s, end; | off_t off, maxio, s, end; | ||||
int i, n_bios, j; | int i, n_bios, j; | ||||
size_t bios_size; | size_t bios_size; | ||||
maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize); | maxio = maxphys - (maxphys % cp->provider->sectorsize); | ||||
n_bios = 0; | n_bios = 0; | ||||
/* How many bios are required for all commands ? */ | /* How many bios are required for all commands ? */ | ||||
for (i = 0; i < ncmds; i++) | for (i = 0; i < ncmds; i++) | ||||
n_bios += (sizes[i] + maxio - 1) / maxio; | n_bios += (sizes[i] + maxio - 1) / maxio; | ||||
/* Allocate memory for the bios */ | /* Allocate memory for the bios */ | ||||
bios_size = n_bios * sizeof (struct bio *); | bios_size = n_bios * sizeof (struct bio *); | ||||
▲ Show 20 Lines • Show All 816 Lines • Show Last 20 Lines |