From c2c4d05700008d245b0a703ad95fe47b36105a9a Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 19 Jul 2021 11:56:58 -0400 Subject: [PATCH] FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+ Reviewed-by: Allan Jude Reviewed-by: Ryan Moeller Signed-off-by: Alexander Motin Closes #12378 --- module/os/freebsd/zfs/vdev_geom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/os/freebsd/zfs/vdev_geom.c b/module/os/freebsd/zfs/vdev_geom.c index 2353c46002..6ac37da1c5 100644 --- a/module/os/freebsd/zfs/vdev_geom.c +++ b/module/os/freebsd/zfs/vdev_geom.c @@ -381,7 +381,11 @@ vdev_geom_io(struct g_consumer *cp, int *cmds, void **datas, off_t *offsets, int i, n_bios, j; size_t bios_size; +#if __FreeBSD_version > 1300130 + maxio = maxphys - (maxphys % cp->provider->sectorsize); +#else maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize); +#endif n_bios = 0; /* How many bios are required for all commands ? */