Reduce reliance on sys/sysproto.h pollution

Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.

sys/sysproto.h currently includes sys/acl.h which currently includes
sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in
sys/errno.h sys/malloc.h.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44465
This commit is contained in:
Brooks Davis 2024-04-15 17:53:05 +01:00
parent 101c80fe46
commit 6bb132ba1e
16 changed files with 21 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/mtio.h> #include <sys/mtio.h>
#include <sys/queue.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/extattr.h> #include <sys/extattr.h>

View File

@ -34,6 +34,7 @@
#include <sys/capsicum.h> #include <sys/capsicum.h>
#include <sys/conf.h> #include <sys/conf.h>
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h> #include <sys/module.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/proc.h> #include <sys/proc.h>

View File

@ -33,6 +33,7 @@
#include <sys/file.h> #include <sys/file.h>
#include <sys/ktr.h> #include <sys/ktr.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/resourcevar.h> #include <sys/resourcevar.h>

View File

@ -35,6 +35,7 @@
#ifndef _LINUX_UTIL_H_ #ifndef _LINUX_UTIL_H_
#define _LINUX_UTIL_H_ #define _LINUX_UTIL_H_
#include <sys/malloc.h>
#include <sys/uio.h> #include <sys/uio.h>
extern int linux_debug; extern int linux_debug;

View File

@ -31,6 +31,7 @@
#include <sys/conf.h> #include <sys/conf.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <sys/kthread.h> #include <sys/kthread.h>
#include <sys/malloc.h>
#include <sys/module.h> #include <sys/module.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/syscallsubr.h> #include <sys/syscallsubr.h>

View File

@ -31,6 +31,8 @@
#ifndef AUTOFS_H #ifndef AUTOFS_H
#define AUTOFS_H #define AUTOFS_H
#include <vm/uma.h>
#define VFSTOAUTOFS(mp) ((struct autofs_mount *)((mp)->mnt_data)) #define VFSTOAUTOFS(mp) ((struct autofs_mount *)((mp)->mnt_data))
MALLOC_DECLARE(M_AUTOFS); MALLOC_DECLARE(M_AUTOFS);

View File

@ -64,6 +64,7 @@
#include <vm/vm_pager.h> #include <vm/vm_pager.h>
#include <vm/vm_extern.h> #include <vm/vm_extern.h>
#include <vm/swap_pager.h> #include <vm/swap_pager.h>
#include <vm/uma.h>
#include <fs/tmpfs/tmpfs.h> #include <fs/tmpfs/tmpfs.h>
#include <fs/tmpfs/tmpfs_fifoops.h> #include <fs/tmpfs/tmpfs_fifoops.h>

View File

@ -54,6 +54,8 @@
#include <security/mac/mac_framework.h> #include <security/mac/mac_framework.h>
#include <vm/uma.h>
static char *_getenv_dynamic_locked(const char *name, int *idx); static char *_getenv_dynamic_locked(const char *name, int *idx);
static char *_getenv_dynamic(const char *name, int *idx); static char *_getenv_dynamic(const char *name, int *idx);

View File

@ -30,6 +30,7 @@
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/cpuset.h> #include <sys/cpuset.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/membarrier.h> #include <sys/membarrier.h>
#include <sys/mutex.h> #include <sys/mutex.h>
#include <sys/proc.h> #include <sys/proc.h>

View File

@ -34,6 +34,7 @@
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/capsicum.h> #include <sys/capsicum.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/mutex.h> #include <sys/mutex.h>
#include <sys/priv.h> #include <sys/priv.h>

View File

@ -72,6 +72,8 @@
#include <sys/syscallsubr.h> #include <sys/syscallsubr.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <vm/uma.h>
#ifdef REGRESSION #ifdef REGRESSION
FEATURE(regression, FEATURE(regression,
"Kernel support for interfaces necessary for regression testing (SECURITY RISK!)"); "Kernel support for interfaces necessary for regression testing (SECURITY RISK!)");

View File

@ -39,6 +39,7 @@
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/limits.h> #include <sys/limits.h>
#include <sys/loginclass.h> #include <sys/loginclass.h>
#include <sys/malloc.h>
#include <sys/priv.h> #include <sys/priv.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/racct.h> #include <sys/racct.h>
@ -2205,6 +2206,7 @@ rctl_init(void)
#else /* !RCTL */ #else /* !RCTL */
#include <sys/types.h> #include <sys/types.h>
#include <sys/errno.h>
#include <sys/sysproto.h> #include <sys/sysproto.h>
int int

View File

@ -58,6 +58,7 @@
#include <vm/vm.h> #include <vm/vm.h>
#include <vm/vm_extern.h> #include <vm/vm_extern.h>
#include <vm/uma.h>
#define MAX_CLOCKS (CLOCK_MONOTONIC+1) #define MAX_CLOCKS (CLOCK_MONOTONIC+1)
#define CPUCLOCK_BIT 0x80000000 #define CPUCLOCK_BIT 0x80000000

View File

@ -67,6 +67,7 @@
#include <vm/vm.h> #include <vm/vm.h>
#include <vm/vm_param.h> #include <vm/vm_param.h>
#include <vm/pmap.h> #include <vm/pmap.h>
#include <vm/uma.h>
#include <vm/vm_map.h> #include <vm/vm_map.h>
#include <vm/vm_object.h> #include <vm/vm_object.h>

View File

@ -30,6 +30,7 @@
#include <sys/endian.h> #include <sys/endian.h>
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h> #include <sys/mutex.h>
#include <sys/sbuf.h> #include <sys/sbuf.h>
#include <sys/socket.h> #include <sys/socket.h>

View File

@ -38,6 +38,8 @@
#include <sys/_seqc.h> #include <sys/_seqc.h>
#include <sys/_uio.h> #include <sys/_uio.h>
#include <vm/uma.h>
enum nameiop { LOOKUP, CREATE, DELETE, RENAME }; enum nameiop { LOOKUP, CREATE, DELETE, RENAME };
struct componentname { struct componentname {