Page MenuHomeFreeBSD

libsysdecode: add zfs iocs
Needs ReviewPublic

Authored by yuripv on Jul 18 2023, 12:51 PM.
Tags
None
Referenced Files
F82292683: D41063.diff
Sat, Apr 27, 9:17 AM
Unknown Object (File)
Mar 27 2024, 9:57 AM
Unknown Object (File)
Dec 23 2023, 3:18 AM
Unknown Object (File)
Dec 10 2023, 8:47 PM
Unknown Object (File)
Oct 12 2023, 10:40 AM
Unknown Object (File)
Oct 1 2023, 3:29 PM
Unknown Object (File)
Sep 24 2023, 8:00 PM
Unknown Object (File)
Aug 14 2023, 2:59 PM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

We do not get usual definitions for ZFS ioctls and sys/fs/zfs.h
does not get installed, so this is a special case.

Test Plan
$ truss zpool get autotrim 2>&1 | grep ioctl
__sysctlbyname("vfs.zfs.version.ioctl",21,0x289547ea07b4,0x289547ea07b8,0x0,0) = 0 (0x0)
ioctl(3,ZFS_IOC_POOL_CONFIGS,0x289547ea07b8)     = 0 (0x0)
ioctl(3,ZFS_IOC_POOL_STATS,0x289547ea0778)       = 0 (0x0)
ioctl(3,ZFS_IOC_POOL_GET_PROPS,0x289547ea02c8)   = 0 (0x0)
ioctl(3,ZFS_IOC_POOL_STATS,0x289547ea0778)       = 0 (0x0)
ioctl(3,ZFS_IOC_POOL_GET_PROPS,0x289547ea02c8)   = 0 (0x0)
ioctl(3,ZFS_IOC_LOG_HISTORY,0x289547ea0a08)      ERR#1 'Operation not permitted'

Diff Detail

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

Event Timeline

darius-dons.net.au added inline comments.
lib/libsysdecode/mkioctls
80

Isn't hrtime_t a long long? (probably only an issue on 32 bit platforms)

yuripv added inline comments.
lib/libsysdecode/mkioctls
80

it shouldn't really matter what type is specified as long as preprocessor groks this header without including the ones that provide real boolean_t and hrtime_t as that conflicts with other required headers here -- we are only interested in iocs enum and don't really use anything else (and the library was successfully built for lib32).

lib/libsysdecode/mkioctls
80

OK makes sense (I thought it might cause alignment problems.)

cy added inline comments.
lib/libsysdecode/mkioctls
107

Isn't this misplaced now?

yuripv added inline comments.
lib/libsysdecode/mkioctls
107

No, awk part now prints the function header and "dynamic" ioctls, then we continue with zfs ones, and the print the function ending:

...
        else if (val == WDIOC_SETSOFTTIMEOUTACT)
                str = "WDIOC_SETSOFTTIMEOUTACT";
        else if (val == WDIOC_SETTIMEOUT)
                str = "WDIOC_SETTIMEOUT";
        else if ((val & 0xffff) == ZFS_IOC_BOOKMARK + ('Z' << 8))
                str = "ZFS_IOC_BOOKMARK";
        else if ((val & 0xffff) == ZFS_IOC_CHANGE_KEY + ('Z' << 8))
                str = "ZFS_IOC_CHANGE_KEY";
...