nfs: Convert nfs 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:46 +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/nfs/file.c
fs/nfs/read.c
include/linux/nfs_fs.h

index f05c4b18b681e5b00d5f6a5d0ec6e91902946879..4f6d1f90b87fd97ea28614c2b71f94d2807dc388 100644 (file)
@@ -337,7 +337,7 @@ start:
        } else if (!once_thru &&
                   nfs_want_read_modify_write(file, page, pos, len)) {
                once_thru = 1;
-               ret = nfs_readpage(file, page);
+               ret = nfs_read_folio(file, page_folio(page));
                put_page(page);
                if (!ret)
                        goto start;
@@ -514,7 +514,7 @@ static void nfs_swap_deactivate(struct file *file)
 }
 
 const struct address_space_operations nfs_file_aops = {
-       .readpage = nfs_readpage,
+       .read_folio = nfs_read_folio,
        .readahead = nfs_readahead,
        .dirty_folio = filemap_dirty_folio,
        .writepage = nfs_writepage,
index 5e7657374bc3f86b7ee1fa67050ac5870abe459e..5a9b043662e913dfebab53c426b8852778ec832a 100644 (file)
@@ -333,8 +333,9 @@ out:
  *  -  The error flag is set for this page. This happens only when a
  *     previous async read operation failed.
  */
-int nfs_readpage(struct file *file, struct page *page)
+int nfs_read_folio(struct file *file, struct folio *folio)
 {
+       struct page *page = &folio->page;
        struct nfs_readdesc desc;
        struct inode *inode = page_file_mapping(page)->host;
        int ret;
index b48b9259e02c74344d0d54c64e77b616bad9b3bc..1bba71757d6221b7d395fcc69c009f89cda35958 100644 (file)
@@ -594,7 +594,7 @@ static inline bool nfs_have_writebacks(const struct inode *inode)
 /*
  * linux/fs/nfs/read.c
  */
-extern int  nfs_readpage(struct file *, struct page *);
+int  nfs_read_folio(struct file *, struct folio *);
 void nfs_readahead(struct readahead_control *);
 
 /*