Page MenuHomeFreeBSD

libprocstat: Drop zfs_defs.c hack, including its _KERNEL define
ClosedPublic

Authored by jrtc27 on Jun 6 2025, 2:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 21, 1:09 PM
Unknown Object (File)
Sat, Jul 12, 2:54 AM
Unknown Object (File)
Wed, Jul 9, 4:11 AM
Unknown Object (File)
Tue, Jul 8, 2:55 PM
Unknown Object (File)
Mon, Jul 7, 7:20 AM
Unknown Object (File)
Sat, Jul 5, 11:29 PM
Unknown Object (File)
Sat, Jul 5, 6:59 PM
Unknown Object (File)
Thu, Jul 3, 1:14 AM
Subscribers

Details

Summary

Now that we have a _WANT_ZNODE we can use that instead of defining
_KERNEL, and we're able to move the code back into zfs.c using a real
znode_t pointer.

Whilst here, tidy the includes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64678
Build 61562: arc lint + arc unit

Event Timeline

jrtc27 requested review of this revision.Jun 6 2025, 2:15 PM

Thanks

lib/libprocstat/Makefile
71

What a long list of args. Any chance there's a make variable for all this?

lib/libprocstat/zfs.c
45

Why move it? Just tidying or was the old location now breaking? The move is fine, but I'm curious.

This revision is now accepted and ready to land.Jun 6 2025, 2:54 PM
lib/libprocstat/Makefile
71

Of course not :) don't go looking for how many similar copies of this there are. The real answer is probably in part at least that it needs to vary between uses...

lib/libprocstat/zfs.c
45

Just tidying as a good citizen

kib added inline comments.
lib/libprocstat/zfs.c
83–84

Is this comment still relevant?

lib/libprocstat/zfs.c
83–84

Yes :( OpenZFS's SPL shadows sys/vnode.h with its own that doesn't include ours; IIRC the end result is struct vnode is an incomplete type here. OpenZFS is still a pile of hacks in the name of trying to pretend both its supported OSes are Solaris, rather than using its own namespaced abstractions...

lib/libprocstat/zfs.c
83–84

Indeed. The OpenZFS integration is its own special kind of hell. Too much is inlined, so too many things need to know about other things and the namespace abstractions are just barely up to the task, but here's one of the holes for sure.

lib/libprocstat/zfs.c
83–84

Your rant is better than the cryptic comment above, I suggest you to put in there. Perhaps in the separate commit to not delay this one.

Also, in commit above, if kept, vnode.h should be replaced by freebsd/sys/sys/vnode.h or such.

This revision now requires review to proceed.Jun 16 2025, 8:19 PM
This revision is now accepted and ready to land.Jun 16 2025, 8:56 PM