mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
FreeBSD: make adjustments for the standalone environment
In FreeBSD, there are three compile environments that are supported: user land, the kernel and the bootloader / standalone. Adjust the headers to compile in the standalone environment. Limit kernel-only items from view when _STANDALONE is defined. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Warner Losh <imp@FreeBSD.org> Closes #10998
This commit is contained in:
@@ -23,8 +23,11 @@
|
||||
|
||||
#ifndef _SPL_KSTAT_H
|
||||
#define _SPL_KSTAT_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef _STANDALONE
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
struct list_head {};
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/proc.h>
|
||||
@@ -128,9 +131,10 @@ struct kstat_s {
|
||||
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */
|
||||
char *ks_raw_buf; /* buf used for raw ops */
|
||||
size_t ks_raw_bufsize; /* size of raw ops buffer */
|
||||
#ifndef _STANDALONE
|
||||
struct sysctl_ctx_list ks_sysctl_ctx;
|
||||
struct sysctl_oid *ks_sysctl_root;
|
||||
|
||||
#endif /* _STANDALONE */
|
||||
};
|
||||
|
||||
typedef struct kstat_named_s {
|
||||
@@ -215,10 +219,16 @@ extern void kstat_runq_exit(kstat_io_t *);
|
||||
__kstat_set_seq_raw_ops(k, h, d, a)
|
||||
#define kstat_set_raw_ops(k, h, d, a) \
|
||||
__kstat_set_raw_ops(k, h, d, a)
|
||||
#ifndef _STANDALONE
|
||||
#define kstat_create(m, i, n, c, t, s, f) \
|
||||
__kstat_create(m, i, n, c, t, s, f)
|
||||
|
||||
#define kstat_install(k) __kstat_install(k)
|
||||
#define kstat_delete(k) __kstat_delete(k)
|
||||
#else
|
||||
#define kstat_create(m, i, n, c, t, s, f) ((kstat_t *)0)
|
||||
#define kstat_install(k)
|
||||
#define kstat_delete(k)
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_KSTAT_H */
|
||||
|
||||
Reference in New Issue
Block a user