]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libprocstat: fix ZFS support
authorAndriy Gapon <avg@FreeBSD.org>
Fri, 22 May 2020 11:20:23 +0000 (11:20 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Fri, 22 May 2020 11:20:23 +0000 (11:20 +0000)
commit8a719b0cee8bb1cdfd81bb08c4be702bb8321a86
tree59d45e8e5032cbe976409b03dbd6759a5b9c80a7
parent524bf3a96b5512fc52db362a5e45a013f724a6f6
libprocstat: fix ZFS support

First of all, znode_phys_t hasn't been used for storing file attributes
for a long time now.  Modern ZFS versions use a System Attribute table
with a flexible layout.  But more importantly all the required
information is available in znode_t itself.

It's not easy to include zfs_znode.h in userland without breaking code
because the most interesting parts of the header are kernel-only. And
hardcoding field offsets is too fragile.  So, I created a new
compilation unit that includes zfs_znode.h using some mild kludges to
get it and its dependencies to compile in userland.  The compilation
unit exports interesting field offsets and does not have any other code.

PR: 194117
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D24941
lib/libprocstat/Makefile
lib/libprocstat/zfs.c
lib/libprocstat/zfs/Makefile
lib/libprocstat/zfs_defs.c [new file with mode: 0644]
lib/libprocstat/zfs_defs.h [new file with mode: 0644]