File: 0014-add-support-for-Linux-6.9.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 (41 lines) | stat: -rw-r--r-- 1,302 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
From 988f0bfc38c096d594fb66925f387fa92032b6a2 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Wed, 14 Aug 2024 09:55:35 +0200
Subject: [PATCH] add support for Linux 6.9

adjust for Linux v6.9-rc1 commit
"block: pass a queue_limits argument to blk_alloc_disk"
(74fa8f9c553f7b5ccab7d103acae63cc2e080465)

Fixes: #185
---
 module/rapiddisk.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/module/rapiddisk.c b/module/rapiddisk.c
index 6560aeb..1a0479f 100644
--- a/module/rapiddisk.c
+++ b/module/rapiddisk.c
@@ -807,12 +807,18 @@ static int attach_device(unsigned long num, unsigned long long size)
 	blk_queue_make_request(rdsk->rdsk_queue, rdsk_make_request);
 #endif
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+	disk = rdsk->rdsk_disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
 	disk = rdsk->rdsk_disk = blk_alloc_disk(NUMA_NO_NODE);
 #else
 	disk = rdsk->rdsk_disk = alloc_disk(1);
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+	if (IS_ERR(disk))
+#else
 	if (!disk)
+#endif
 		goto out_free_queue;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
 	blk_queue_logical_block_size(disk->queue, BYTES_PER_SECTOR);
-- 
2.39.5