fs: Convert netfs_readpage to netfs_read_folio

This is straightforward because netfs already worked in terms of folios.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 08830c8b
...@@ -336,7 +336,7 @@ static bool v9fs_dirty_folio(struct address_space *mapping, struct folio *folio) ...@@ -336,7 +336,7 @@ static bool v9fs_dirty_folio(struct address_space *mapping, struct folio *folio)
#endif #endif
const struct address_space_operations v9fs_addr_operations = { const struct address_space_operations v9fs_addr_operations = {
.readpage = netfs_readpage, .read_folio = netfs_read_folio,
.readahead = netfs_readahead, .readahead = netfs_readahead,
.dirty_folio = v9fs_dirty_folio, .dirty_folio = v9fs_dirty_folio,
.writepage = v9fs_vfs_writepage, .writepage = v9fs_vfs_writepage,
......
...@@ -50,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = { ...@@ -50,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = {
}; };
const struct address_space_operations afs_file_aops = { const struct address_space_operations afs_file_aops = {
.readpage = netfs_readpage, .read_folio = netfs_read_folio,
.readahead = netfs_readahead, .readahead = netfs_readahead,
.dirty_folio = afs_dirty_folio, .dirty_folio = afs_dirty_folio,
.launder_folio = afs_launder_folio, .launder_folio = afs_launder_folio,
......
...@@ -1372,7 +1372,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping, ...@@ -1372,7 +1372,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
} }
const struct address_space_operations ceph_aops = { const struct address_space_operations ceph_aops = {
.readpage = netfs_readpage, .read_folio = netfs_read_folio,
.readahead = netfs_readahead, .readahead = netfs_readahead,
.writepage = ceph_writepage, .writepage = ceph_writepage,
.writepages = ceph_writepages_start, .writepages = ceph_writepages_start,
......
...@@ -198,22 +198,21 @@ void netfs_readahead(struct readahead_control *ractl) ...@@ -198,22 +198,21 @@ void netfs_readahead(struct readahead_control *ractl)
EXPORT_SYMBOL(netfs_readahead); 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 * @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 * Fulfil a read_folio request by drawing data from the cache if
* netfs if not. Space beyond the EOF is zero-filled. Multiple I/O requests * possible, or the netfs if not. Space beyond the EOF is zero-filled.
* from different sources will get munged together. * Multiple I/O requests from different sources will get munged together.
* *
* The calling netfs must initialise a netfs context contiguous to the vfs * The calling netfs must initialise a netfs context contiguous to the vfs
* inode before calling this. * inode before calling this.
* *
* This is usable whether or not caching is enabled. * 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 address_space *mapping = folio_file_mapping(folio);
struct netfs_io_request *rreq; struct netfs_io_request *rreq;
struct netfs_i_context *ctx = netfs_i_context(mapping->host); struct netfs_i_context *ctx = netfs_i_context(mapping->host);
...@@ -245,7 +244,7 @@ int netfs_readpage(struct file *file, struct page *subpage) ...@@ -245,7 +244,7 @@ int netfs_readpage(struct file *file, struct page *subpage)
folio_unlock(folio); folio_unlock(folio);
return ret; return ret;
} }
EXPORT_SYMBOL(netfs_readpage); EXPORT_SYMBOL(netfs_read_folio);
/* /*
* Prepare a folio for writing without reading first * Prepare a folio for writing without reading first
......
...@@ -274,7 +274,7 @@ struct netfs_cache_ops { ...@@ -274,7 +274,7 @@ struct netfs_cache_ops {
struct readahead_control; struct readahead_control;
extern void netfs_readahead(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 *, extern int netfs_write_begin(struct file *, struct address_space *,
loff_t, unsigned int, struct folio **, loff_t, unsigned int, struct folio **,
void **); void **);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment