From 774dcba86d2b00cafc14abb48b565efeb0b9c986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Matu=C5=A1ka?= Date: Wed, 9 Oct 2024 18:27:46 +0200 Subject: [PATCH] FreeBSD: ignore some includes when not building kernel The function abd_alloc_from_pages() is used only in kernel. Excluding sys/vm.h, and vm/vm_page.h includes avoids dependency problems. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Martin Matuska Closes #16616 --- include/os/freebsd/zfs/sys/abd_os.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/os/freebsd/zfs/sys/abd_os.h b/include/os/freebsd/zfs/sys/abd_os.h index be825b3b8a43..401c8452d6b8 100644 --- a/include/os/freebsd/zfs/sys/abd_os.h +++ b/include/os/freebsd/zfs/sys/abd_os.h @@ -26,8 +26,10 @@ #ifndef _ABD_OS_H #define _ABD_OS_H +#ifdef _KERNEL #include #include +#endif #ifdef __cplusplus extern "C" { @@ -47,8 +49,10 @@ struct abd_linear { #endif }; +#ifdef _KERNEL __attribute__((malloc)) struct abd *abd_alloc_from_pages(vm_page_t *, unsigned long, uint64_t); +#endif #ifdef __cplusplus }