From 04083bc9a31156e34782b689993737f7c9def427 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Sun, 9 Jul 2023 18:52:23 -0600 Subject: [PATCH 1/4] Linux 6.5: Replace generic_file_splice_read The Linux 6.5 commit: 'splice: Remove generic_file_splice_read()' (c6585011bc) replaces the function generic_file_splice_read() with the function filemap_splice_read(). The Linux function 'filemap_splice_read()' was introduced with the Linux 6.3 commits: 'splice: Add a func to do a splice from a buffered file without ITER_PIPE' (07073eb01c) 'splice: Export filemap/direct_splice_read()' (7c8e01ebf2) With updates in Linux 6.5: 'splice: Fix filemap_splice_read() to use the correct inode' (c37222082f) -- which fixes a problem in the code. 'splice: Make filemap_splice_read() check s_maxbytes' (83aeff881e) Due to the fact that there could be problems with splice support prior to Linux 6.5 (where filemap_splice_read()'s use was expanded to additional filesystems other than just cifs), we only want to use 'filemap_splice_read()' in Linux 6.5 and later. The LINUX/osi_vnodeops.c file is updated to use 'filemap_splice_read()', for Linux 6.5 and later, for the splice_read member of the file_operations structure. Reviewed-on: https://gerrit.openafs.org/15486 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit 0e06eb78f293bb295b0fe12da24abd8dc1160149) Change-Id: I3b5436234d275253a37987dc40a522ae8f3cae1e Reviewed-on: https://gerrit.openafs.org/15520 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand (cherry picked from commit fef245769366efe8694ddadd1e1f2ed5ef8608f4) --- src/afs/LINUX/osi_vnodeops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index ccec38289..dd8b39d5d 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -960,7 +960,11 @@ struct file_operations afs_file_fops = { # else .splice_write = generic_file_splice_write, # endif +# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0) + .splice_read = filemap_splice_read, +# else .splice_read = generic_file_splice_read, +# endif #endif .release = afs_linux_release, .fsync = afs_linux_fsync, -- 2.42.0