From 20e11dfb21ff12589ecc3df4301b333135e5a4fc Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Wed, 10 Feb 2021 10:02:51 +0100 Subject: Add support for AlmaLinux 8 --- src/kernel/xloop_main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/kernel/xloop_main.c b/src/kernel/xloop_main.c index 441282a..aa75c41 100644 --- a/src/kernel/xloop_main.c +++ b/src/kernel/xloop_main.c @@ -95,6 +95,13 @@ #include +/* define RHEL_CHECK_VERSION macro to check CentOS version */ +#if defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION) + #define RHEL_CHECK_VERSION(CONDITION) (CONDITION) +#else + #define RHEL_CHECK_VERSION(CONDITION) (0) +#endif + static DEFINE_IDR(xloop_index_idr); static DEFINE_MUTEX(xloop_ctl_mutex); @@ -358,7 +365,8 @@ static void xloop_reread_partitions(struct xloop_device *xlo, { int rc; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) || \ + RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 3)) mutex_lock(&bdev->bd_mutex); rc = bdev_disk_changed(bdev, false); mutex_unlock(&bdev->bd_mutex); @@ -1035,7 +1043,8 @@ out_unlock: * must be at least one and it can only become zero when the * current holder is released. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) || \ + RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 3)) if (!release) mutex_lock(&bdev->bd_mutex); err = bdev_disk_changed(bdev, false); -- cgit v1.2.3-55-g7522