On 4096-aligned drives DIOCGSTRIPEOFFSET ioctl used for determining of partition offset always returns 0. Probably due to a bug. Fallback to value provided by GEOM in that case. It looks correct.
The declaration of the new function diocgstripeoffset and the call to that function is only made if DIOCGFWSECTORS is defined. However, the function seem to need sysctl and sysctl.h and some more .h files are only included if DIOCGFWSECTORS and (APPLE or FreeBSD) is defined.
Do you think that the call and declaration also only should be made if APPLE or FreeBSD is defined? Or would you prefer if the includes were done also without APPLE or FreeBSD?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The declaration and the call is FreeBSD-specific. Like any DIOC... macro. APPLE's ioctl name PREFIX is DKIO rather than DIOC. They share only header file (sys/disk.h) with completely different content.
So only FreeBSD is supported by new code that is achieved with DIOCGFWSECTORS #define check.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the patch!
The declaration of the new function diocgstripeoffset and the call to that function is only made if DIOCGFWSECTORS is defined. However, the function seem to need sysctl and sysctl.h and some more .h files are only included if DIOCGFWSECTORS and (APPLE or FreeBSD) is defined.
Do you think that the call and declaration also only should be made if APPLE or FreeBSD is defined? Or would you prefer if the includes were done also without APPLE or FreeBSD?
The declaration and the call is FreeBSD-specific. Like any DIOC... macro. APPLE's ioctl name PREFIX is DKIO rather than DIOC. They share only header file (sys/disk.h) with completely different content.
So only FreeBSD is supported by new code that is achieved with DIOCGFWSECTORS #define check.