From 01abbb428553c0fc79a2cc6841ef1fbb46a0f9d8 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 14 Aug 2002 01:04:43 +0000 Subject: [PATCH] Move to a nested include of _label.h instead of mac.h in sys/sys/*.h (Most of the places where mac.h was recursively included from another kernel header file. net/netinet to follow.) Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Suggested by: bde --- sys/sys/mbuf.h | 6 +----- sys/sys/mount.h | 2 +- sys/sys/pipe.h | 2 +- sys/sys/socketvar.h | 2 +- sys/sys/ucred.h | 8 +++----- sys/sys/vnode.h | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index c41d8fc10a8..e4a3de83c35 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -37,11 +37,7 @@ #ifndef _SYS_MBUF_H_ #define _SYS_MBUF_H_ -/* - * XXXMAC: Possibly this recursive include is a bad idea, but a lot - * of code exists that assumes it is sufficient to include just mbuf.h - */ -#include +#include /* * Mbufs are of a single size, MSIZE (machine/param.h), which diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 14a1e64435e..3bdce928b68 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -43,10 +43,10 @@ */ #include -#include #include #include #ifdef _KERNEL +#include #include #include #endif diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index 6b501d65138..edbb3884916 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -28,7 +28,7 @@ #include /* for struct timespec */ #include /* for struct selinfo */ #include /* for vm_page_t */ -#include /* for struct label */ +#include /* for struct label */ #include /* for PAGE_SIZE */ #endif diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 81d7f4549f7..9d0a220e432 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -37,7 +37,7 @@ #ifndef _SYS_SOCKETVAR_H_ #define _SYS_SOCKETVAR_H_ -#include /* for struct label */ +#include /* for struct label */ #include /* for TAILQ macros */ #include /* for struct selinfo */ diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 115fb7b8876..7a7881035ae 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -38,12 +38,10 @@ #define _SYS_UCRED_H_ /* - * XXXMAC: Recursively include mac.h due to an API assumption that it - * it is sufficient to include types.h and ucred.h to have a defined - * struct ucred. This should be changed so that struct ucred is not - * exported to userland via _KERNEL. + * XXXMAC: this recursive include could be #ifdef _KERNEL if struct + * ucred could also be #ifdef _KERNEL. */ -#include +#include /* * Credentials. diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 6ac9bf2fe0b..db76e95b1e8 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -44,12 +44,12 @@ #include #include +#include #include #include #include #include #include -#include #include /*