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
383static inline struct page *read_mapping_page(struct address_space *mapping,383static inline struct page *read_mapping_page(struct address_space *mapping,
384 pgoff_t index, void *data)384 pgoff_t index, void *data)
385{385{
386 filler_t *filler = (filler_t *)mapping->a_ops->readpage;386 return read_cache_page(mapping, index, NULL, data);
387 return read_cache_page(mapping, index, filler, data);
388}387}
389 388
390/*389/*
mm/filemap.c+6−4
@@ -2825,7 +2825,11 @@ repeat: · 2824 unmodified lines
2825 }2825 }
2826 2826
2827filler:2827filler:
2828 err = filler(data, page);2828 if (filler)
2829 err = filler(data, page);
2830 else
2831 err = mapping->a_ops->readpage(data, page);
2832
2829 if (err < 0) {2833 if (err < 0) {
2830 put_page(page);2834 put_page(page);
2831 return ERR_PTR(err);2835 return ERR_PTR(err);
@@ -2937,9 +2941,7 @@ struct page *read_cache_page_gfp(struct address_space *mapping, · 105 unmodified lines
2937 pgoff_t index,2941 pgoff_t index,
2938 gfp_t gfp)2942 gfp_t gfp)
2939{2943{
2940 filler_t *filler = (filler_t *)mapping->a_ops->readpage;2944 return do_read_cache_page(mapping, index, NULL, NULL, gfp);
2941
2942 return do_read_cache_page(mapping, index, filler, NULL, gfp);
2943}2945}
2944EXPORT_SYMBOL(read_cache_page_gfp);2946EXPORT_SYMBOL(read_cache_page_gfp);
2945 2947

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