Page MenuHomeFreeBSD

Make <vm/vm_extern.h> more self-contained.
ClosedPublic

Authored by jhb on Jan 27 2022, 9:55 PM.

Details

Summary

Add a nested include of <sys/systm.h> for recently added assertions.
Without this, existing code (such as in drm-kmod) needs to be patched
to add the newly required header.

While here, rewrite the assertions using KASSERT().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb requested review of this revision.Jan 27 2022, 9:55 PM
jhb created this revision.
dougm added reviewers: kib, alc.

I have no objections, but it was kib, I think, who asked for the invariants in the first place, so get his ok too.

This revision is now accepted and ready to land.Jan 27 2022, 10:26 PM

sys/systm.h is of course very heavy weight, perhaps too heavy.

sys/vm/vm_extern.h
157–158

), (

modulo kib's formatting nit.

Hmm. At first this didn't make sense to me. The "assertions" were written this way so that systm.h wouldn't have to be included, but the prototype for panic() is provided by systm.h. So, this code might as well have used KASSERT all along.

jhb marked an inline comment as done.Jan 28 2022, 9:15 PM
In D34070#770387, @kib wrote:

sys/systm.h is of course very heavy weight, perhaps too heavy.

It is, but it is already a nested include in <vm/vm_page.h>.

I would not mind having a <sys/_assert.h> or the like that contained the bits need for KASSERT and friends (MPASS*, panic() prototype, etc.).

This revision was automatically updated to reflect the committed changes.