on 27/04/2012 13:37 Andrey V. Elsukov said the following:
> What you think about this concept:
> We can implement some MI API to query disks count and each disk parameters (mediasize,
> sectorsize). This MI code will use some IOCTL that will act with MD "disk"'s devsw->ioctl.
> devicename.c functions can be changed to use MI DISK API together with PART API,
> or maybe even moved to the MI code.
> In the result we will have some MI API to get access to the disks and partitions,
> that we can use anywhere, e.g. in the ZFS code.
Sorry, but I couldn't understand your design. Probably I am missing the bigger
I think that for ZFS case it would be sufficient to be able to iterate over
detected device names or devspecs. Size and other disk properties do not seem to
be needed. Unless I am mistaken, of course.
E.g. something akin to what bd_print (dv_print, in the general case) does but
oriented towards programmatic use rather than end-user. Maybe all that partition
table parsing should be done only once (e.g. in the init method) and the result
should be saved.