Page MenuHomeFreeBSD

Reduce reliance on sys/sysproto.h pollution
ClosedPublic

Authored by brooks on Mar 21 2024, 11:38 PM.
Tags
None
Referenced Files
F86665116: D44465.id136102.diff
Sun, Jun 23, 5:05 PM
Unknown Object (File)
Thu, Jun 20, 1:29 PM
Unknown Object (File)
Thu, May 30, 10:44 PM
Unknown Object (File)
Mon, May 27, 2:08 AM
Unknown Object (File)
May 19 2024, 5:57 AM
Unknown Object (File)
May 14 2024, 12:00 PM
Unknown Object (File)
May 8 2024, 4:23 AM
Unknown Object (File)
May 6 2024, 9:52 PM
Subscribers

Details

Summary

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

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This review stack is the result of trying to remove sys/acl.h from sys/sysproto.h after 27676ae365f62c22f8daa816bf7a07d22bd081d9 and discovering that there were a lot of things that depended on its header pollution.

kib added inline comments.
sys/kern/kern_time.c
40

This is excessive. Or, at least in other places, the patch depends on vm/uma.h including sys/malloc.h.

This revision is now accepted and ready to land.Mar 22 2024, 3:09 AM
  • Add a sys/queue.h include after _KERNEL ifdef of sys/malloc.h in sys/acl.h
  • Explain sys/malloc.h include in kern_time.c
This revision now requires review to proceed.Mar 22 2024, 8:23 PM

Actually squash in sys/queue.h include

brooks added inline comments.
sys/kern/kern_time.c
40

It took a little poking around, but it turns out we need sys/malloc.h before sys/proc.h for the M_ macros we need to be declared. Arguably that's a bug in sys/proc.h.

sys/kern/kern_time.c
40

The proc.h M_ declarations are under the #ifdef brace. I suspect they could be moved to sys/malloc.h without much hassle.

brooks marked an inline comment as done.

Drop sys/malloc.h in kern_time.c (depends on D44766)

This revision is now accepted and ready to land.Apr 12 2024, 11:36 PM
This revision was automatically updated to reflect the committed changes.