Skip to content

Commit

Permalink
FreeBSD: ignore some includes when not building kernel
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Martin Matuska <[email protected]>
Closes openzfs#16616
  • Loading branch information
mmatuska authored and behlendorf committed Oct 9, 2024
1 parent 09f6b2e commit 774dcba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/os/freebsd/zfs/sys/abd_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
#ifndef _ABD_OS_H
#define _ABD_OS_H

#ifdef _KERNEL
#include <sys/vm.h>
#include <vm/vm_page.h>
#endif

#ifdef __cplusplus
extern "C" {
Expand All @@ -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
}
Expand Down

0 comments on commit 774dcba

Please sign in to comment.