From e089f6c7b94440e785acfff5eea05222ec01e0f7 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Mon, 7 Oct 2024 12:13:34 +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. Signed-off-by: Martin Matuska --- 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 }