ecryptfs: Convert ecryptfs to read_folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 9 May 2022 20:21:45 +0000 (16:21 -0400)
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/ecryptfs/mmap.c

index 47904d4..19af229 100644 (file)
@@ -170,16 +170,17 @@ out:
 }
 
 /**
- * ecryptfs_readpage
+ * ecryptfs_read_folio
  * @file: An eCryptfs file
- * @page: Page from eCryptfs inode mapping into which to stick the read data
+ * @folio: Folio from eCryptfs inode mapping into which to stick the read data
  *
- * Read in a page, decrypting if necessary.
+ * Read in a folio, decrypting if necessary.
  *
  * Returns zero on success; non-zero on error.
  */
-static int ecryptfs_readpage(struct file *file, struct page *page)
+static int ecryptfs_read_folio(struct file *file, struct folio *folio)
 {
+       struct page *page = &folio->page;
        struct ecryptfs_crypt_stat *crypt_stat =
                &ecryptfs_inode_to_private(page->mapping->host)->crypt_stat;
        int rc = 0;
@@ -549,7 +550,7 @@ const struct address_space_operations ecryptfs_aops = {
        .invalidate_folio = block_invalidate_folio,
 #endif
        .writepage = ecryptfs_writepage,
-       .readpage = ecryptfs_readpage,
+       .read_folio = ecryptfs_read_folio,
        .write_begin = ecryptfs_write_begin,
        .write_end = ecryptfs_write_end,
        .bmap = ecryptfs_bmap,