We can just pass a NULL filler and do the right thing inside of do_read_cache_page based on the NULL parameter.
Unified · Split
| @@ -383,8 +383,7 @@ extern int read_cache_pages(struct address_space *mapping, · 382 unmodified lines | ||
| 383 | 383 | static inline struct page *read_mapping_page(struct address_space *mapping, |
| 384 | 384 | pgoff_t index, void *data) |
| 385 | 385 | { |
| 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); | |
| 388 | 387 | } |
| 389 | 388 | |
| 390 | 389 | /* |
| @@ -2825,7 +2825,11 @@ repeat: · 2824 unmodified lines | ||
| 2825 | 2825 | } |
| 2826 | 2826 | |
| 2827 | 2827 | 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 | + | |
| 2829 | 2833 | if (err < 0) { |
| 2830 | 2834 | put_page(page); |
| 2831 | 2835 | return ERR_PTR(err); |
| @@ -2937,9 +2941,7 @@ struct page *read_cache_page_gfp(struct address_space *mapping, · 105 unmodified lines | ||
| 2937 | 2941 | pgoff_t index, |
| 2938 | 2942 | gfp_t gfp) |
| 2939 | 2943 | { |
| 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); | |
| 2943 | 2945 | } |
| 2944 | 2946 | EXPORT_SYMBOL(read_cache_page_gfp); |
| 2945 | 2947 | |