Re: Get size of block character device file with stat()

2020-05-25 Thread Oleg Evseev
> The bch driver supports an IOCTL called BIOC_GEOMETRY that will return the geometry of the underlying block device. Yes, I understand. But user application handle all files the same way using path and int stat(FAR const char *path, FAR struct stat *buf) function. I've made a pull request #1118

Re: Get size of block character device file with stat()

2020-05-25 Thread Gregory Nutt
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

Re: Get size of block character device file with stat()

2020-05-25 Thread Oleg Evseev
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. пн, 25 мая 2