mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
FreeBSD: Use the new freeuio() helper to free dynamically allocated UIOs (#16300)
This freeuio() interface was introduced to FreeBSD recently. For now it simply calls free(), so this change has no effect. However, this may not always be true, and in CheriBSD this change is required. Signed-off-by: Mark Johnston <markj@FreeBSD.org> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brooks Davis <brooks.davis@sri.com> Reviewed-by: Tony Hutter <hutter2@llnl.gov>
This commit is contained in:
parent
156a64161b
commit
a10faf5ce6
@ -45,6 +45,16 @@
|
|||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
#include <sys/zfs_znode.h>
|
#include <sys/zfs_znode.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
zfs_freeuio(struct uio *uio)
|
||||||
|
{
|
||||||
|
#if __FreeBSD_version > 1500013
|
||||||
|
freeuio(uio);
|
||||||
|
#else
|
||||||
|
free(uio, M_IOV);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
zfs_uiomove(void *cp, size_t n, zfs_uio_rw_t dir, zfs_uio_t *uio)
|
zfs_uiomove(void *cp, size_t n, zfs_uio_rw_t dir, zfs_uio_t *uio)
|
||||||
{
|
{
|
||||||
@ -77,7 +87,7 @@ zfs_uiocopy(void *p, size_t n, zfs_uio_rw_t rw, zfs_uio_t *uio, size_t *cbytes)
|
|||||||
error = vn_io_fault_uiomove(p, n, uio_clone);
|
error = vn_io_fault_uiomove(p, n, uio_clone);
|
||||||
*cbytes = zfs_uio_resid(uio) - uio_clone->uio_resid;
|
*cbytes = zfs_uio_resid(uio) - uio_clone->uio_resid;
|
||||||
if (uio_clone != &small_uio_clone)
|
if (uio_clone != &small_uio_clone)
|
||||||
free(uio_clone, M_IOV);
|
zfs_freeuio(uio_clone);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user