From 606ae13ac801a51ab32ecead085eb9c895d10940 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 May 2021 09:02:55 +0300 Subject: [PATCH] kernel 5.12.x support --- module/rapiddisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/rapiddisk.c b/module/rapiddisk.c index a059f00..4b70a13 100644 --- a/module/rapiddisk.c +++ b/module/rapiddisk.c @@ -487,7 +487,7 @@ rdsk_submit_bio(struct bio *bio) rdsk_make_request(struct request_queue *q, struct bio *bio) #endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0)) struct rdsk_device *rdsk = bio->bi_disk->private_data; #else struct block_device *bdev = bio->bi_bdev; @@ -511,7 +511,7 @@ rdsk_make_request(struct request_queue *q, struct bio *bio) #else sector = bio->bi_sector; #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0)) if ((sector + bio_sectors(bio)) > get_capacity(bio->bi_disk)) #else if ((sector + bio_sectors(bio)) > get_capacity(bdev->bd_disk))