Page MenuHomeFreeBSD

sys: Avoid relying on pollution from refcount.h
ClosedPublic

Authored by markj on Nov 5 2024, 3:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 25 2024, 4:11 AM
Unknown Object (File)
Nov 22 2024, 9:28 AM
Unknown Object (File)
Nov 8 2024, 1:01 AM
Unknown Object (File)
Nov 7 2024, 10:38 AM
Unknown Object (File)
Nov 5 2024, 6:28 PM
Subscribers

Details

Summary

Fix up headers which previously assumed that refcount.h includes
systm.h, and make them more self-contained. Then, replace the systm.h
include in refcount with kassert.h.

MFC after: 1 week

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 5 2024, 3:37 PM

We have tests to make sure that some (most) of the sys/*.h files are self-contained.
Can we remove anything from the 'known bad' lists after this?

This revision is now accepted and ready to land.Nov 5 2024, 3:44 PM

Remove refcount.h from badfiles.inc

This revision now requires review to proceed.Nov 5 2024, 3:53 PM
kib added inline comments.
sys/sys/refcount.h
49

u_int comes from machine/atomic.h->sys/atomic_common.h->sys/types.h.
Do we want to rely on this, or should sys/types.h included there directly?

This revision is now accepted and ready to land.Nov 5 2024, 3:53 PM

Bring in sys/types.h for u_int

This revision now requires review to proceed.Nov 5 2024, 4:02 PM
markj marked an inline comment as done.Nov 5 2024, 4:03 PM
markj added inline comments.
sys/sys/refcount.h
49

I'd rather replace u_int with unsigned int, but it's a lot of churn.

This revision is now accepted and ready to land.Nov 5 2024, 4:32 PM
sys/sys/refcount.h
49

That might be only marginally better. You'd avoid the namespace pollution of types.h, since u_int isn't defined in _types.h.. But it would be a lot more churn...
So either choice is fine.

This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.