Skip to content

Commit 4a02185

Browse files
committed
afs: Enable multipage folio support
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author David Howells <dhowells@redhat.com> commit 8549a26 Enable multipage folio support for the afs filesystem. Support has already been implemented in netfslib, fscache and cachefiles and in most of afs, but I've waited for Matthew Wilcox's latest folio changes. Note that it does require a change to afs_write_begin() to return the correct subpage. This is a "temporary" change as we're working on getting rid of the need for ->write_begin() and ->write_end() completely, at least as far as network filesystems are concerned - but it doesn't prevent afs from making use of the capability. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org> Tested-by: kafs-testing@auristor.com Cc: Marc Dionne <marc.dionne@auristor.com> Cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/lkml/2274528.1645833226@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit 8549a26) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent fd6e649 commit 4a02185

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/afs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
104104
inode->i_op = &afs_file_inode_operations;
105105
inode->i_fop = &afs_file_operations;
106106
inode->i_mapping->a_ops = &afs_file_aops;
107+
mapping_set_large_folios(inode->i_mapping);
107108
break;
108109
case AFS_FTYPE_DIR:
109110
inode->i_mode = S_IFDIR | (status->mode & S_IALLUGO);
110111
inode->i_op = &afs_dir_inode_operations;
111112
inode->i_fop = &afs_dir_file_operations;
112113
inode->i_mapping->a_ops = &afs_dir_aops;
114+
mapping_set_large_folios(inode->i_mapping);
113115
break;
114116
case AFS_FTYPE_SYMLINK:
115117
/* Symlinks with a mode of 0644 are actually mountpoints. */

fs/afs/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
9191
goto flush_conflicting_write;
9292
}
9393

94-
*_page = &folio->page;
94+
*_page = folio_file_page(folio, pos / PAGE_SIZE);
9595
_leave(" = 0");
9696
return 0;
9797

0 commit comments

Comments
 (0)