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.

Reply via email to