Don't hard-code number of ioctls for portability
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 <faaland1@llnl.gov> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com> Closes #8598
This commit is contained in:
parent
96e51d2773
commit
703f791d35
|
@ -37,7 +37,7 @@ const char *active_test;
|
||||||
/*
|
/*
|
||||||
* Tracks which zfs_ioc_t commands were tested
|
* 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)
|
* Legacy ioctls that are skipped (for now)
|
||||||
|
|
Loading…
Reference in New Issue