summarylogtreecommitdiffstats
path: root/0009-LINUX-Use-folio_page-to-convert-folio-to-page.patch
blob: 5696390b470db77aa0a77e8f8aac7b5e1ff7ba81 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 7ac828855acd0c1c38daa9ad0828d6b8fbf13176 Mon Sep 17 00:00:00 2001
From: Andrew Deason <adeason@sinenomine.net>
Date: Mon, 2 Jun 2025 12:18:19 -0500
Subject: [PATCH 09/18] LINUX: Use folio_page() to convert folio to page

A few pieces of code are currently converting a folio into a page via
&folio->page. But the macro folio_page() can do this for us; use that
instead, so we don't need to know the details of how folios/pages are
stored together.

The macro folio_page() was introduced in Linux commit 7b230db3b8d3 (mm:
Introduce struct folio), and so should always be available when folios
themselves are.

Reviewed-on: https://gerrit.openafs.org/16389
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit f168b1432175ef1d624cd80736864828c5efbe18)

Change-Id: I0c7acd39e493963ebcb28c83fbda8452296edbd2
Reviewed-on: https://gerrit.openafs.org/16431
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 39ce8f11df2d650bb4d86c76c127c292880a5c76)
---
 src/afs/LINUX/osi_vnodeops.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index dedc3f391..b0b600256 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -2365,7 +2365,7 @@ afs_page_cache_alloc(struct address_space *cachemapping)
     if (folio == NULL) {
 	return NULL;
     }
-    return &folio->page;
+    return folio_page(folio, 0);
 #else
     return page_cache_alloc(cachemapping);
 #endif
@@ -3013,7 +3013,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
 static int
 afs_linux_read_folio(struct file *fp, struct folio *folio)
 {
-    struct page *pp = &folio->page;
+    struct page *pp = folio_page(folio, 0);
 
     return afs_linux_readpage(fp, pp);
 }
@@ -3628,7 +3628,7 @@ afs_linux_write_end(struct file *file, struct address_space *mapping,
 {
     int code;
     unsigned int from = pos & (PAGE_SIZE - 1);
-    struct page *page = &folio->page;
+    struct page *page = folio_page(folio, 0);
 
     code = afs_linux_commit_write(file, page, from, from + copied);
 
@@ -3877,7 +3877,7 @@ afs_symlink_filler(struct file *file, struct page *page)
 static int
 afs_symlink_filler_folio(struct file *file, struct folio *folio)
 {
-    struct page *page = &folio->page;
+    struct page *page = folio_page(folio, 0);
     return afs_symlink_filler(file, page);
 }
 #endif
-- 
2.51.0