File: 0004-Linux-6.18-replace-nth_page.patch

package info (click to toggle)
zfs-linux 2.3.5-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 71,372 kB
  • sloc: ansic: 393,918; sh: 67,823; asm: 47,734; python: 8,163; makefile: 5,129; perl: 859; sed: 41
file content (44 lines) | stat: -rw-r--r-- 1,294 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
From 9d50ee59dc13dbb376ec738808da9d95226b44fe Mon Sep 17 00:00:00 2001
From: Rob Norris <robn@despairlabs.com>
Date: Fri, 12 Sep 2025 09:57:53 +1000
Subject: [PATCH 1/7] Linux 6.18: replace nth_page()

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn@despairlabs.com>

Last-Update: 2025-11-19
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
---
 module/os/linux/zfs/abd_os.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/module/os/linux/zfs/abd_os.c b/module/os/linux/zfs/abd_os.c
index 8a8316f63..18f2426fb 100644
--- a/module/os/linux/zfs/abd_os.c
+++ b/module/os/linux/zfs/abd_os.c
@@ -23,6 +23,7 @@
  * Copyright (c) 2014 by Chunwei Chen. All rights reserved.
  * Copyright (c) 2019 by Delphix. All rights reserved.
  * Copyright (c) 2023, 2024, Klara Inc.
+ * Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
  */
 
 /*
@@ -1109,6 +1110,14 @@ abd_return_buf_copy(abd_t *abd, void *buf, size_t n)
 #define	ABD_ITER_PAGE_SIZE(page)	(PAGESIZE)
 #endif
 
+#ifndef nth_page
+/*
+ * Since 6.18 nth_page() no longer exists, and is no longer required to iterate
+ * within a single SG entry, so we replace it with a simple addition.
+ */
+#define	nth_page(p, n)	((p)+(n))
+#endif
+
 void
 abd_iter_page(struct abd_iter *aiter)
 {
-- 
2.43.0