Remove #define _KERNEL hacks from libprocstat

Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in
userspace, assuming that the consumer has an idea what it is for.
Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h,
sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the
same caveat.

Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h
being unusable in userspace, where it override struct buf with its own
definition.  Instead, provide struct m_buf and struct m_vnode and adapt
code to use local variants.

Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D28679
This commit is contained in:
Konstantin Belousov
2021-02-18 15:43:58 +02:00
parent 750ea20d3f
commit d485c77f20
36 changed files with 225 additions and 156 deletions
+1 -2
View File
@@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/vnode.h>
#include <sys/conf.h>
#define _KERNEL
#include <sys/pipe.h>
#define _WANT_MOUNT
#include <sys/mount.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include <ufs/ufs/ufsmount.h>
#include <fs/devfs/devfs.h>
#include <fs/devfs/devfs_int.h>
#undef _KERNEL
#include <nfs/nfsproto.h>
#include <nfsclient/nfs.h>
#include <nfsclient/nfsnode.h>
+1 -4
View File
@@ -68,15 +68,12 @@ __FBSDID("$FreeBSD$");
#include <sys/mman.h>
#include <sys/capsicum.h>
#include <sys/ptrace.h>
#define _KERNEL
#define _WANT_MOUNT
#include <sys/mount.h>
#include <sys/filedesc.h>
#include <sys/pipe.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <fs/devfs/devfs.h>
#include <fs/devfs/devfs_int.h>
#undef _KERNEL
#include <nfs/nfsproto.h>
#include <nfsclient/nfs.h>
#include <nfsclient/nfsnode.h>
+1 -1
View File
@@ -71,7 +71,7 @@ struct vattr {
long va_spare; /* remain quad aligned */
};
#define _WANT_MOUNT
#include <sys/zfs_context.h>
#include <sys/zfs_znode.h>