diff options
| author | Matt Macy <mmacy@FreeBSD.org> | 2020-08-25 02:21:27 +0000 |
|---|---|---|
| committer | Matt Macy <mmacy@FreeBSD.org> | 2020-08-25 02:21:27 +0000 |
| commit | 9e5787d2284e187abb5b654d924394a65772e004 (patch) | |
| tree | 2ebf833af6b1953d4a683e2da830fe87bf3435e1 /lib/libprocstat | |
| parent | 22df1ffd812f0395cdb7c0b1edae1f67b991562a (diff) | |
Notes
Diffstat (limited to 'lib/libprocstat')
| -rw-r--r-- | lib/libprocstat/libprocstat.c | 1 | ||||
| -rw-r--r-- | lib/libprocstat/zfs/Makefile | 22 | ||||
| -rw-r--r-- | lib/libprocstat/zfs_defs.c | 44 |
3 files changed, 47 insertions, 20 deletions
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index f48abd99c12f..7be6a224eb82 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include <sys/ptrace.h> #define _KERNEL #include <sys/mount.h> +#include <sys/filedesc.h> #include <sys/pipe.h> #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> diff --git a/lib/libprocstat/zfs/Makefile b/lib/libprocstat/zfs/Makefile index 880118fbc643..75e4a253fd4d 100644 --- a/lib/libprocstat/zfs/Makefile +++ b/lib/libprocstat/zfs/Makefile @@ -6,15 +6,19 @@ SRCS= zfs_defs.c OBJS= zfs_defs.o WARNS?= 1 -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR:H} -CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -I. -I${.CURDIR} +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include + +CFLAGS+= -I${SRCTOP}/sys -I. -I.. +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID -D_SYS_VMEM_H_ -UKLD_TIED -DKLD_MODULE + CFLAGS+= -fno-builtin -nostdlib all: ${OBJS} diff --git a/lib/libprocstat/zfs_defs.c b/lib/libprocstat/zfs_defs.c index 3258b6c5567e..c41054f05136 100644 --- a/lib/libprocstat/zfs_defs.c +++ b/lib/libprocstat/zfs_defs.c @@ -26,13 +26,9 @@ */ #include <sys/cdefs.h> +#include <sys/types.h> __FBSDID("$FreeBSD$"); -/* Pretend we are kernel to get the same binary layout. */ -#define _KERNEL - -/* A hack to deal with kpilite.h. */ -#define KLD_MODULE /* * Prevent some headers from getting included and fake some types @@ -41,14 +37,40 @@ __FBSDID("$FreeBSD$"); */ #define _OPENSOLARIS_SYS_PATHNAME_H_ #define _OPENSOLARIS_SYS_POLICY_H_ -#define _OPENSOLARIS_SYS_VNODE_H_ #define _VNODE_PAGER_ -typedef struct vnode vnode_t; -typedef struct vattr vattr_t; -typedef struct xvattr xvattr_t; -typedef struct vsecattr vsecattr_t; -typedef enum vtype vtype_t; + +enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, + VMARKER }; + +/* + * Vnode attributes. A field value of VNOVAL represents a field whose value + * is unavailable (getattr) or which is not to be changed (setattr). + */ +struct vattr { + enum vtype va_type; /* vnode type (for create) */ + u_short va_mode; /* files access mode and type */ + u_short va_padding0; + uid_t va_uid; /* owner user id */ + gid_t va_gid; /* owner group id */ + nlink_t va_nlink; /* number of references to file */ + dev_t va_fsid; /* filesystem id */ + ino_t va_fileid; /* file id */ + u_quad_t va_size; /* file size in bytes */ + long va_blocksize; /* blocksize preferred for i/o */ + struct timespec va_atime; /* time of last access */ + struct timespec va_mtime; /* time of last modification */ + struct timespec va_ctime; /* time file changed */ + struct timespec va_birthtime; /* time file created */ + u_long va_gen; /* generation number of file */ + u_long va_flags; /* flags defined for file */ + dev_t va_rdev; /* device the special file represents */ + u_quad_t va_bytes; /* bytes of disk space held by file */ + u_quad_t va_filerev; /* file modification number */ + u_int va_vaflags; /* operations flags, see below */ + long va_spare; /* remain quad aligned */ +}; + #include <sys/zfs_context.h> #include <sys/zfs_znode.h> |
