aboutsummaryrefslogtreecommitdiff
path: root/module/os/freebsd/spl/spl_uio.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/os/freebsd/spl/spl_uio.c')
-rw-r--r--module/os/freebsd/spl/spl_uio.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/module/os/freebsd/spl/spl_uio.c b/module/os/freebsd/spl/spl_uio.c
index 0bf251a1edac..17886cbeb501 100644
--- a/module/os/freebsd/spl/spl_uio.c
+++ b/module/os/freebsd/spl/spl_uio.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -45,6 +45,16 @@
#include <sys/vnode.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
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);
*cbytes = zfs_uio_resid(uio) - uio_clone->uio_resid;
if (uio_clone != &small_uio_clone)
- free(uio_clone, M_IOV);
+ zfs_freeuio(uio_clone);
return (error);
}