History

fs: Convert netfs_readpage to netfs_read_folio

This is straightforward because netfs already worked in terms of folios.

Matthew Wilcox (Oracle) committed 4 years ago

Commit 6c623711 parent 08830c85 files · +11 −12Browse files

Unified · Split

5 files
  1. fs/9p/vfs_addr.c +1 −1
  2. fs/afs/file.c +1 −1
  3. fs/ceph/addr.c +1 −1
  4. fs/netfs/buffered_read.c +7 −8
  5. include/linux/netfs.h +1 −1
fs/9p/vfs_addr.c+1−1
@@ -336,7 +336,7 @@ static bool v9fs_dirty_folio(struct address_space *mapping, struct folio *folio) · 335 unmodified lines
336336 #endif
337337
338338 const struct address_space_operations v9fs_addr_operations = {
339− .readpage = netfs_readpage,
339+ .read_folio = netfs_read_folio,
340340 .readahead = netfs_readahead,
341341 .dirty_folio = v9fs_dirty_folio,
342342 .writepage = v9fs_vfs_writepage,
fs/afs/file.c+1−1
@@ -50,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = { · 49 unmodified lines
5050 };
5151
5252 const struct address_space_operations afs_file_aops = {
53− .readpage = netfs_readpage,
53+ .read_folio = netfs_read_folio,
5454 .readahead = netfs_readahead,
5555 .dirty_folio = afs_dirty_folio,
5656 .launder_folio = afs_launder_folio,
fs/ceph/addr.c+1−1
@@ -1372,7 +1372,7 @@ out: · 1371 unmodified lines
13721372 }
13731373
13741374 const struct address_space_operations ceph_aops = {
1375− .readpage = netfs_readpage,
1375+ .read_folio = netfs_read_folio,
13761376 .readahead = netfs_readahead,
13771377 .writepage = ceph_writepage,
13781378 .writepages = ceph_writepages_start,
fs/netfs/buffered_read.c+7−8
@@ -198,22 +198,21 @@ cleanup_free: · 197 unmodified lines
198198 EXPORT_SYMBOL(netfs_readahead);
199199
200200 /**
201− * netfs_readpage - Helper to manage a readpage request
201+ * netfs_read_folio - Helper to manage a read_folio request
202202 * @file: The file to read from
203− * @subpage: A subpage of the folio to read
203+ * @folio: The folio to read
204204 *
205− * Fulfil a readpage request by drawing data from the cache if possible, or the
206− * netfs if not. Space beyond the EOF is zero-filled. Multiple I/O requests
207− * from different sources will get munged together.
205+ * Fulfil a read_folio request by drawing data from the cache if
206+ * possible, or the netfs if not. Space beyond the EOF is zero-filled.
207+ * Multiple I/O requests from different sources will get munged together.
208208 *
209209 * The calling netfs must initialise a netfs context contiguous to the vfs
210210 * inode before calling this.
211211 *
212212 * This is usable whether or not caching is enabled.
213213 */
214−int netfs_readpage(struct file *file, struct page *subpage)
214+int netfs_read_folio(struct file *file, struct folio *folio)
215215 {
216− struct folio *folio = page_folio(subpage);
217216 struct address_space *mapping = folio_file_mapping(folio);
218217 struct netfs_io_request *rreq;
219218 struct netfs_i_context *ctx = netfs_i_context(mapping->host);
@@ -245,7 +244,7 @@ alloc_error: · 25 unmodified lines
245244 folio_unlock(folio);
246245 return ret;
247246 }
248−EXPORT_SYMBOL(netfs_readpage);
247+EXPORT_SYMBOL(netfs_read_folio);
249248
250249 /*
251250 * Prepare a folio for writing without reading first
include/linux/netfs.h+1−1
@@ -274,7 +274,7 @@ struct netfs_cache_ops { · 273 unmodified lines
274274
275275 struct readahead_control;
276276 extern void netfs_readahead(struct readahead_control *);
277−extern int netfs_readpage(struct file *, struct page *);
277+int netfs_read_folio(struct file *, struct folio *);
278278 extern int netfs_write_begin(struct file *, struct address_space *,
279279 loff_t, unsigned int, struct folio **,
280280 void **);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t