File 7eda374.diff of Package openafs

From 7eda3745a797040f509b2d9961c2b25d904bc7c7 Mon Sep 17 00:00:00 2001
From: Andrew Deason <adeason@sinenomine.net>
Date: Mon, 02 Jun 2025 12:18:19 -0500
Subject: [PATCH] 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
---

diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 9ae1211..2fbcac7 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -2365,7 +2365,7 @@
     if (folio == NULL) {
 	return NULL;
     }
-    return &folio->page;
+    return folio_page(folio, 0);
 #else
     return page_cache_alloc(cachemapping);
 #endif
@@ -3013,7 +3013,7 @@
 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 @@
 {
     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 @@
 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
openSUSE Build Service is sponsored by