Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WestonReed
Copy link

bdev->bd_inode was removed in 6.10; replace it with bdev_nr_sectors

See kernel commit: torvalds/linux@203c1ce

Closes #256

bdev->bd_inode was removed in 6.10; replace it with bdev_nr_sectors
Comment on lines +119 to +123
#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
Copy link
Author

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.

Copy link
Owner

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.

Comment on lines +119 to +123
#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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

module build fails for Linux 6.10
2 participants