From 9d66204292a4fcaa7a5b77568cdb5376ac87d3aa Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 3 Apr 2024 14:03:02 +0200 Subject: [KERNEL] Fix build on Linux 6.8 and CentOS 9.5 --- src/kernel/xloop_main_6.6.c | 4 ++++ src/kernel/xloop_main_rhel_9.0.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/kernel/xloop_main_6.6.c b/src/kernel/xloop_main_6.6.c index 871ce7b..d5c7f16 100644 --- a/src/kernel/xloop_main_6.6.c +++ b/src/kernel/xloop_main_6.6.c @@ -1827,7 +1827,11 @@ static int xloop_add(int i) } xlo->xlo_queue = xlo->xlo_disk->queue; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + blk_queue_max_hw_sectors(xlo->xlo_queue, BLK_DEF_MAX_SECTORS_CAP); +#else blk_queue_max_hw_sectors(xlo->xlo_queue, BLK_DEF_MAX_SECTORS); +#endif /* * By default, we do buffer IO, so it doesn't make sense to enable diff --git a/src/kernel/xloop_main_rhel_9.0.c b/src/kernel/xloop_main_rhel_9.0.c index 0d82b79..e35284e 100644 --- a/src/kernel/xloop_main_rhel_9.0.c +++ b/src/kernel/xloop_main_rhel_9.0.c @@ -2092,7 +2092,11 @@ static int xloop_add(int i) } xlo->xlo_queue = xlo->xlo_disk->queue; +#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5) + blk_queue_max_hw_sectors(xlo->xlo_queue, BLK_DEF_MAX_SECTORS_CAP); +#else blk_queue_max_hw_sectors(xlo->xlo_queue, BLK_DEF_MAX_SECTORS); +#endif /* * By default, we do buffer IO, so it doesn't make sense to enable -- cgit v1.2.3-55-g7522