Page MenuHomeFreeBSD

Adjustments to includes for openzfs
ClosedPublic

Authored by imp on Sep 24 2020, 6:19 AM.

Details

Summary

Tweak systm.h to work in a standalone env

Most of the heavy lifting is done by limiting most of this file to only the kernel, since that's the only thing that actually uses those bits.

Diff Detail

Repository
rS 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

imp requested review of this revision.Sep 24 2020, 6:19 AM
imp created this revision.
imp added a reviewer: jhb.

This revision successfully builds and reboots, so I think it's right But since it's systm.h and we do some funky monkey business in there, I'd like more eyes on it to be sure.

put nullability macro outside kernel ifdefs

It's safer to put __NULLABILITY_PRAGMA_PUSH/POP ouside the kernel
ifdefs since we drop and pick it up. future changes my oops.

sys/sys/systm.h
110 ↗(On Diff #77485)

It's hard to imagine that you are using VNASSERT() outside of the kernel.

Which of these are you actually using? I still think new code should use _Static_assert() directly rather than CTASSERT, and KASSERT() is kind of crummy due to its lack of using VAR_ARGS, so I would rather stand.h grow a useful macro that works with VAR_ARGS instead rather than repeating that mistake if possible.

sys/sys/systm.h
110 ↗(On Diff #77485)

This is for old code being brought into stand: There's bits of ZFS that are now being more aggressively pulled in. So there's no repeat of the past, just using things... I'll confirm they are actually used, though...

Rejigger

KASSERT, et al, now are a printf in the boot loader. We don't
have enough milage to turn it on just yet.

Respond to jhk's good feedback...

sys/sys/systm.h
214 ↗(On Diff #77550)

Note: we should likely fix this... there's only two files (and not one per arch) that use it. osreldate is more wide spread

imp marked an inline comment as done.

Ah, this comment was correct, restore after the move.

tsoome added a subscriber: tsoome.

I think printf is ok to have.

This revision is now accepted and ready to land.Fri, Sep 25, 8:00 PM

Thanks for double checking.

This revision was automatically updated to reflect the committed changes.