Skip to content

Commit

Permalink
Don't hard-code number of ioctls for portability
Browse files Browse the repository at this point in the history
Use (ZFS_IOC_LAST - ZFS_IOC_FIRST) instead of 256.
It seems 256 is just a number large enough to hold ioctls
at the moment.

Using 256 also causes compile-time warning or error
on platfoms whose enum zfs_ioc definition differs.

Reviewed-by: Olaf Faaland <[email protected]>
Reviewed by: Brian Behlendorf <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>
Signed-off-by: Tomohiro Kusumi <[email protected]>
Closes openzfs#8598
  • Loading branch information
kusumi authored and behlendorf committed Apr 14, 2019
1 parent 96e51d2 commit 703f791
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const char *active_test;
/*
* Tracks which zfs_ioc_t commands were tested
*/
boolean_t ioc_tested[256];
boolean_t ioc_tested[ZFS_IOC_LAST - ZFS_IOC_FIRST];

/*
* Legacy ioctls that are skipped (for now)
Expand Down

0 comments on commit 703f791

Please sign in to comment.