File: 0005-Adding-support-for-newer-RHEL-9.2-and-CentOS-Stream-.patch

package info (click to toggle)
rapiddisk 9.0.0-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,192 kB
  • sloc: ansic: 6,495; sh: 1,364; makefile: 328
file content (56 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 6fb53bb1ec94a8adf20332be767a61a6924fd832 Mon Sep 17 00:00:00 2001
From: Petros Koutoupis <petros@petroskoutoupis.com>
Date: Fri, 2 Jun 2023 07:24:22 -0500
Subject: [PATCH] Adding support for newer RHEL 9.2 and CentOS Stream 9
 kernels.

---
 module/rapiddisk-cache.c | 5 +++++
 module/rapiddisk.c       | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/rapiddisk-cache.c b/module/rapiddisk-cache.c
index 9f6a234..54d6392 100644
--- a/module/rapiddisk-cache.c
+++ b/module/rapiddisk-cache.c
@@ -177,10 +177,15 @@ int dm_io_async_bvec(unsigned int num_regions, struct dm_io_region *where,
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0)
 	(rw == WRITE) ? (iorq.bi_opf = REQ_OP_WRITE) : (iorq.bi_opf = REQ_OP_READ);
+#else
+//#if (defined(RHEL_MAJOR) && RHEL_MAJOR >= 9 && RHEL_MINOR >= 2)
+#if (defined(RHEL_MAJOR) && RHEL_MAJOR >= 9)
+	iorq.bi_opf = rw;
 #else
 	iorq.bi_op = rw;
 	iorq.bi_op_flags = 0;
 #endif
+#endif
 #else
 	iorq.bi_rw = rw;
 #endif
diff --git a/module/rapiddisk.c b/module/rapiddisk.c
index eb20779..55ebc7d 100644
--- a/module/rapiddisk.c
+++ b/module/rapiddisk.c
@@ -75,7 +75,7 @@ static DEFINE_MUTEX(ioctl_mutex);
 
 struct rdsk_device {
 	int num;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
 	struct request_queue *rdsk_queue;
 #endif
 	struct gendisk *rdsk_disk;
@@ -928,7 +928,7 @@ static int detach_device(unsigned long num)
 	list_del(&rdsk->rdsk_list);
 	del_gendisk(rdsk->rdsk_disk);
 	put_disk(rdsk->rdsk_disk);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
 	blk_cleanup_queue(rdsk->rdsk_queue);
 #endif
 	rdsk_free_pages(rdsk);
-- 
2.39.5