diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2006-06-23 02:05:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 07:43:02 -0700 |
commit | 090d2b185d8680fc26a2eaf4245d4171dcf4baf1 (patch) | |
tree | 67e604e3cd1bad3cfd034bced19a0fbff6a80c30 /include | |
parent | c330dda908b5a46469a997eea90b66f2f9f02b34 (diff) | |
download | linux-3.10-090d2b185d8680fc26a2eaf4245d4171dcf4baf1.tar.gz linux-3.10-090d2b185d8680fc26a2eaf4245d4171dcf4baf1.tar.bz2 linux-3.10-090d2b185d8680fc26a2eaf4245d4171dcf4baf1.zip |
[PATCH] read_mapping_page for address space
Add read_mapping_page() which is used for callers that pass
mapping->a_ops->readpage as the filler for read_cache_page. This removes
some duplication from filesystem code.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pagemap.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7a1af574ded..1245df7141a 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping, extern int read_cache_pages(struct address_space *mapping, struct list_head *pages, filler_t *filler, void *data); +static inline struct page *read_mapping_page(struct address_space *mapping, + unsigned long index, void *data) +{ + filler_t *filler = (filler_t *)mapping->a_ops->readpage; + return read_cache_page(mapping, index, filler, data); +} + int add_to_page_cache(struct page *page, struct address_space *mapping, unsigned long index, gfp_t gfp_mask); int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |