diff options
Diffstat (limited to '0006-Linux-5.18-replace-set_page_dirty-with-dirty_folio.patch')
-rw-r--r-- | 0006-Linux-5.18-replace-set_page_dirty-with-dirty_folio.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/0006-Linux-5.18-replace-set_page_dirty-with-dirty_folio.patch b/0006-Linux-5.18-replace-set_page_dirty-with-dirty_folio.patch new file mode 100644 index 000000000000..631d2e4b9afe --- /dev/null +++ b/0006-Linux-5.18-replace-set_page_dirty-with-dirty_folio.patch @@ -0,0 +1,64 @@ +From 081869eb8ba1733a044468203ab82affe258b359 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Wed, 30 Mar 2022 11:09:45 -0600 +Subject: [PATCH 06/12] Linux-5.18 replace set_page_dirty with dirty_folio + +The commits going into Linux 5.18: + + fs: Add aops->dirty_folio (6f31a5a261db) + fs: Convert __set_page_dirty_buffers to block_dirty_folio (e621900ad2) + fs: Remove aops ->set_page_dirty (3a3bae50af) + +replaces the address_space_operations structure member set_page_dirty +which with dirty_folio. The linux function __set_page_dirty_buffers is +replaced by block_dirty_folio. + +Nothing within afs uses or implements the set_page_dirty function, +however the structure member is required to be initialized. + +Add an autoconf test for the dirty_folio member and if present, set the +address_space_operations member dirty_folio to block_dirty_folio +instead of setting the set_page_dirty member. + +Change-Id: Iad6783308989f4a1390c1c94d2c571048bd4e771 +Reviewed-on: https://gerrit.openafs.org/14939 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 6aa129e743e882cf30c35afd67eabf82274c5fca) +--- + src/afs/LINUX/osi_vnodeops.c | 4 ++++ + src/cf/linux-kernel-struct.m4 | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 00103a538..a0c78c04d 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -3288,7 +3288,11 @@ static struct address_space_operations afs_file_aops = { + .readpage = afs_linux_readpage, + .readpages = afs_linux_readpages, + .writepage = afs_linux_writepage, ++#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_DIRTY_FOLIO) ++ .dirty_folio = block_dirty_folio, ++#else + .set_page_dirty = __set_page_dirty_buffers, ++#endif + #if defined (STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_WRITE_BEGIN) + .write_begin = afs_linux_write_begin, + .write_end = afs_linux_write_end, +diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4 +index 003d34ab8..2d8cee655 100644 +--- a/src/cf/linux-kernel-struct.m4 ++++ b/src/cf/linux-kernel-struct.m4 +@@ -3,6 +3,8 @@ dnl Check for structure elements + AC_CHECK_LINUX_STRUCT([address_space], [backing_dev_info], [fs.h]) + AC_CHECK_LINUX_STRUCT([address_space_operations], + [write_begin], [fs.h]) ++dnl linux 5.18 replaced set_page_dirty with dirty_folio ++AC_CHECK_LINUX_STRUCT([address_space_operations], [dirty_folio], [fs.h]) + AC_CHECK_LINUX_STRUCT([backing_dev_info], [name], + [backing-dev.h]) + AC_CHECK_LINUX_STRUCT([cred], [session_keyring], [cred.h]) +-- +2.36.1 + |