fs: Convert netfs_readpage to netfs_read_folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 29 Apr 2022 12:49:28 +0000 (08:49 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 9 May 2022 20:21:44 +0000 (16:21 -0400)
This is straightforward because netfs already worked in terms of folios.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/9p/vfs_addr.c
fs/afs/file.c
fs/ceph/addr.c
fs/netfs/buffered_read.c
include/linux/netfs.h

index a2d57112f53ec24d9d578b474520e251adc67276..3a84167f489351f32691736457e7b6d62c2edb4c 100644 (file)
@@ -336,7 +336,7 @@ static bool v9fs_dirty_folio(struct address_space *mapping, struct folio *folio)
 #endif
 
 const struct address_space_operations v9fs_addr_operations = {
-       .readpage = netfs_readpage,
+       .read_folio = netfs_read_folio,
        .readahead = netfs_readahead,
        .dirty_folio = v9fs_dirty_folio,
        .writepage = v9fs_vfs_writepage,
index 26292a110a8f9abf03471a402fdf567a4a6bfcc0..e277fbe552625ee1bf00e0808ead161619bf6fb0 100644 (file)
@@ -50,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = {
 };
 
 const struct address_space_operations afs_file_aops = {
-       .readpage       = netfs_readpage,
+       .read_folio     = netfs_read_folio,
        .readahead      = netfs_readahead,
        .dirty_folio    = afs_dirty_folio,
        .launder_folio  = afs_launder_folio,
index 42bba2b5d98bc42e4994e529a7d30760f31d0f2e..be3e47784f08da25bc7521e84e816eb61c791992 100644 (file)
@@ -1372,7 +1372,7 @@ out:
 }
 
 const struct address_space_operations ceph_aops = {
-       .readpage = netfs_readpage,
+       .read_folio = netfs_read_folio,
        .readahead = netfs_readahead,
        .writepage = ceph_writepage,
        .writepages = ceph_writepages_start,
index 1d44509455a50a5cc7a56020b7388c6fc36df86d..8742d22dfd2b240ee9695af5c284b5b4b44cbb3c 100644 (file)
@@ -198,22 +198,21 @@ cleanup_free:
 EXPORT_SYMBOL(netfs_readahead);
 
 /**
- * netfs_readpage - Helper to manage a readpage request
+ * netfs_read_folio - Helper to manage a read_folio request
  * @file: The file to read from
- * @subpage: A subpage of the folio to read
+ * @folio: The folio to read
  *
- * Fulfil a readpage request by drawing data from the cache if possible, or the
- * netfs if not.  Space beyond the EOF is zero-filled.  Multiple I/O requests
- * from different sources will get munged together.
+ * Fulfil a read_folio request by drawing data from the cache if
+ * possible, or the netfs if not.  Space beyond the EOF is zero-filled.
+ * Multiple I/O requests from different sources will get munged together.
  *
  * The calling netfs must initialise a netfs context contiguous to the vfs
  * inode before calling this.
  *
  * This is usable whether or not caching is enabled.
  */
-int netfs_readpage(struct file *file, struct page *subpage)
+int netfs_read_folio(struct file *file, struct folio *folio)
 {
-       struct folio *folio = page_folio(subpage);
        struct address_space *mapping = folio_file_mapping(folio);
        struct netfs_io_request *rreq;
        struct netfs_i_context *ctx = netfs_i_context(mapping->host);
@@ -245,7 +244,7 @@ alloc_error:
        folio_unlock(folio);
        return ret;
 }
-EXPORT_SYMBOL(netfs_readpage);
+EXPORT_SYMBOL(netfs_read_folio);
 
 /*
  * Prepare a folio for writing without reading first
index 1c29f317d907b74b6add0c2afa7fba9af3dffc6a..4bd5ee709daa3b59175774037ed262ddb2968dae 100644 (file)
@@ -274,7 +274,7 @@ struct netfs_cache_ops {
 
 struct readahead_control;
 extern void netfs_readahead(struct readahead_control *);
-extern int netfs_readpage(struct file *, struct page *);
+int netfs_read_folio(struct file *, struct folio *);
 extern int netfs_write_begin(struct file *, struct address_space *,
                             loff_t, unsigned int, struct folio **,
                             void **);