Skip to contentSkip to conversation

afs: Enable multipage folio support

PATCH In review David Howells 3 participants 3 messages Feb 25, 2022 – Apr 2, 2022

Subsystems (3)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 afs: Enable multipage folio support

Enable multipage folio support for the afs filesystem. This is on top of Matthew Wilcox's for-next branch.

---
 fs/afs/inode.c |    2 ++
 fs/afs/write.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/afs/inode.c +2 -0
index 5964f8aee090..7dc7eb5f8e63 100644
@@ -96,12 +96,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
 		inode->i_op	= &afs_file_inode_operations;
 		inode->i_fop	= &afs_file_operations;
 		inode->i_mapping->a_ops	= &afs_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_DIR:
 		inode->i_mode	= S_IFDIR |  (status->mode & S_IALLUGO);
 		inode->i_op	= &afs_dir_inode_operations;
 		inode->i_fop	= &afs_dir_file_operations;
 		inode->i_mapping->a_ops	= &afs_dir_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_SYMLINK:
 		/* Symlinks with a mode of 0644 are actually mountpoints. */
fs/afs/write.c +1 -1
index 5e9157d0da29..d6cc0fa44316 100644
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
 			goto flush_conflicting_write;
 	}
 
-	*_page = &folio->page;
+	*_page = folio_file_page(folio, pos / PAGE_SIZE);
 	_leave(" = 0");
 	return 0;
 
#1 lore raw
I love your patch! Yet something to improve:

Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on dhowells-fs/fscache-next]
[also build test ERROR on linux/master linus/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/David-Howells/afs-Enable-multipage-folio-support/20220226-075436
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-next
config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20220226/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/91637acf6da0c809e1bedc59696d6bc0a8604f03
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Howells/afs-Enable-multipage-folio-support/20220226-075436 git checkout 91637acf6da0c809e1bedc59696d6bc0a8604f03
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> ERROR: modpost: "PageHeadHuge" [fs/afs/kafs.ko] undefined!

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Acked-by on v1 1/1
#2 lore raw
In reply to David Howells
Quoted 7 lines · David Howells

Enable multipage folio support for the afs filesystem. This is on top of Matthew Wilcox's for-next branch.

I can't say that I've audited AFS for its correct use of folios everywhere, but since you've tested it, I have no objections: