-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dm-writeboost-target.c: Fix build error in 6.10 #259
base: master
Are you sure you want to change the base?
Conversation
bdev->bd_inode was removed in 6.10; replace it with bdev_nr_sectors
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) | ||
return i_size_read(dev->bdev->bd_inode) >> 9; | ||
#else | ||
return bdev_nr_sectors(dev->bdev); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bdev_nr_sectors
was added in 5.11, so we could switch this to build with 5.11+ kernels instead. I'm unsure what the best practice here is though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WestonReed Thank you for the PR.
Not sure this is the best practice in the community though, I think the switch boundary should be 5.11 to make the code more informative: your suggestion here seems to me that bdev_nr_sectors
was introduced in 6.10.
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) | ||
return i_size_read(dev->bdev->bd_inode) >> 9; | ||
#else | ||
return bdev_nr_sectors(dev->bdev); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WestonReed Thank you for the PR.
Not sure this is the best practice in the community though, I think the switch boundary should be 5.11 to make the code more informative: your suggestion here seems to me that bdev_nr_sectors
was introduced in 6.10.
bdev->bd_inode
was removed in 6.10; replace it withbdev_nr_sectors
See kernel commit: torvalds/linux@203c1ce
Closes #256