History

mm/filemap: don't cast ->readpage to filler_t for do_read_cache_page

We can just pass a NULL filler and do the right thing inside of do_read_cache_page based on the NULL parameter.

Christoph Hellwig committed 7 years ago

Commit 6c45b451 parent d322a8e2 files · +7 −6Browse files

Unified · Split

2 files
  1. include/linux/pagemap.h +1 −2
  2. mm/filemap.c +6 −4
include/linux/pagemap.h+1−2
@@ -383,8 +383,7 @@ extern int read_cache_pages(struct address_space *mapping, · 382 unmodified lines
383383 static inline struct page *read_mapping_page(struct address_space *mapping,
384384 pgoff_t index, void *data)
385385 {
386− filler_t *filler = (filler_t *)mapping->a_ops->readpage;
387− return read_cache_page(mapping, index, filler, data);
386+ return read_cache_page(mapping, index, NULL, data);
388387 }
389388
390389 /*
mm/filemap.c+6−4
@@ -2825,7 +2825,11 @@ repeat: · 2824 unmodified lines
28252825 }
28262826
28272827 filler:
2828− err = filler(data, page);
2828+ if (filler)
2829+ err = filler(data, page);
2830+ else
2831+ err = mapping->a_ops->readpage(data, page);
2832+
28292833 if (err < 0) {
28302834 put_page(page);
28312835 return ERR_PTR(err);
@@ -2937,9 +2941,7 @@ struct page *read_cache_page_gfp(struct address_space *mapping, · 105 unmodified lines
29372941 pgoff_t index,
29382942 gfp_t gfp)
29392943 {
2940− filler_t *filler = (filler_t *)mapping->a_ops->readpage;
2941−
2942− return do_read_cache_page(mapping, index, filler, NULL, gfp);
2944+ return do_read_cache_page(mapping, index, NULL, NULL, gfp);
29432945 }
29442946 EXPORT_SYMBOL(read_cache_page_gfp);
29452947

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