It looks like I overthink and the best and simple solution is just to use
for all block devices the block_operation function of inode to get geometry:
inode->u.i_bops->geometry
I miss that bchlib is already use this function to fill bchlib_s structure.
Will try this approach now.
The bch driver supports an IOCTL called BIOC_GEOMETRY that will return
the geometry of the underlying block device.
- Get size of block character device file with stat() Oleg Evseev
- Re: Get size of block character device file with stat() Oleg Evseev
- Re: Get size of block character device file with sta... Gregory Nutt
