Build error with kernel 6.10
Opened this issue · 3 comments
manualinux commented
When compiling the module with kernel 6.10, the following error message occurs:
drivers/block/rapiddisk/rapiddisk-cache.c:1045:47: error: no member named 'bd_inode' in 'struct block_device'
1045 | dmc->size = to_sector(dmc->cache_dev->bdev->bd_inode->i_size);
| ~~~~~~~~~~~~~~~~~~~~ ^
drivers/block/rapiddisk/rapiddisk-cache.c:1081:45: error: no member named 'bd_inode' in 'struct block_device'
1081 | dev_size = to_sector(dmc->cache_dev->bdev->bd_inode->i_size);
| ~~~~~~~~~~~~~~~~~~~~ ^
2 errors generated.
The link to the kernel code modification that produces the error.
Regards
anbe42 commented
Can we replace to_sector(dmc->cache_dev->bdev->bd_inode->i_size)
with bdev_nr_sectors(dmc->cache_dev->bdev)
?
bdev_nr_sectors()
was introduced in Linux v5.11 (torvalds/linux@a782483)
pkoutoupis commented
I will need to look into this, although time has not been kind to me lately and I do apologize for the delay in everything.
manualinux commented
Can we replace
to_sector(dmc->cache_dev->bdev->bd_inode->i_size)
withbdev_nr_sectors(dmc->cache_dev->bdev)
?bdev_nr_sectors()
was introduced in Linux v5.11 (torvalds/linux@a782483)
I have tested it and it works. Thanks for the contribution. @anbe42