提交 c14c6843 编写于 作者: M Matthew Wilcox (Oracle)

fs: read_mapping_page() should take a struct file argument

While read_cache_page() takes a void *, because you can pass a
pointer to anything as the first argument of filler_t, if we
are calling read_mapping_page(), it will be passed as the first
argument of ->readpage, so we know this must be a struct file
pointer, and we should let the compiler enforce that for us.
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
上级 1241ebec
...@@ -636,15 +636,15 @@ extern int read_cache_pages(struct address_space *mapping, ...@@ -636,15 +636,15 @@ extern int read_cache_pages(struct address_space *mapping,
struct list_head *pages, filler_t *filler, void *data); struct list_head *pages, filler_t *filler, void *data);
static inline struct page *read_mapping_page(struct address_space *mapping, static inline struct page *read_mapping_page(struct address_space *mapping,
pgoff_t index, void *data) pgoff_t index, struct file *file)
{ {
return read_cache_page(mapping, index, NULL, data); return read_cache_page(mapping, index, NULL, file);
} }
static inline struct folio *read_mapping_folio(struct address_space *mapping, static inline struct folio *read_mapping_folio(struct address_space *mapping,
pgoff_t index, void *data) pgoff_t index, struct file *file)
{ {
return read_cache_folio(mapping, index, NULL, data); return read_cache_folio(mapping, index, NULL, file);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册