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)
Sun, Oct 12, 5:44 PM
Unknown Object (File)
Tue, Sep 23, 12:37 PM
Unknown Object (File)
Mon, Sep 22, 6:30 AM
Unknown Object (File)
Sep 15 2025, 3:29 PM
Unknown Object (File)
Sep 15 2025, 7:48 AM
Unknown Object (File)
Sep 14 2025, 8:25 AM
Unknown Object (File)
Sep 10 2025, 3:32 AM
Unknown Object (File)
Sep 6 2025, 7:32 PM
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 Not Applicable
Unit
Tests Not Applicable

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
82–83

Is this comment still relevant?

lib/libprocstat/zfs.c
82–83

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
82–83

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
82–83

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