aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e08b5339023c..34ce3ebf97d5 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -16,6 +16,8 @@
16#include <linux/hardirq.h> /* for in_interrupt() */ 16#include <linux/hardirq.h> /* for in_interrupt() */
17#include <linux/hugetlb_inline.h> 17#include <linux/hugetlb_inline.h>
18 18
19struct pagevec;
20
19/* 21/*
20 * Bits in mapping->flags. 22 * Bits in mapping->flags.
21 */ 23 */
@@ -116,7 +118,7 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
116 m->gfp_mask = mask; 118 m->gfp_mask = mask;
117} 119}
118 120
119void release_pages(struct page **pages, int nr, bool cold); 121void release_pages(struct page **pages, int nr);
120 122
121/* 123/*
122 * speculatively take a reference to a page. 124 * speculatively take a reference to a page.
@@ -232,15 +234,9 @@ static inline struct page *page_cache_alloc(struct address_space *x)
232 return __page_cache_alloc(mapping_gfp_mask(x)); 234 return __page_cache_alloc(mapping_gfp_mask(x));
233} 235}
234 236
235static inline struct page *page_cache_alloc_cold(struct address_space *x)
236{
237 return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
238}
239
240static inline gfp_t readahead_gfp_mask(struct address_space *x) 237static inline gfp_t readahead_gfp_mask(struct address_space *x)
241{ 238{
242 return mapping_gfp_mask(x) | 239 return mapping_gfp_mask(x) | __GFP_NORETRY | __GFP_NOWARN;
243 __GFP_COLD | __GFP_NORETRY | __GFP_NOWARN;
244} 240}
245 241
246typedef int filler_t(void *, struct page *); 242typedef int filler_t(void *, struct page *);
@@ -366,8 +362,16 @@ static inline unsigned find_get_pages(struct address_space *mapping,
366} 362}
367unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, 363unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
368 unsigned int nr_pages, struct page **pages); 364 unsigned int nr_pages, struct page **pages);
369unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 365unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index,
370 int tag, unsigned int nr_pages, struct page **pages); 366 pgoff_t end, int tag, unsigned int nr_pages,
367 struct page **pages);
368static inline unsigned find_get_pages_tag(struct address_space *mapping,
369 pgoff_t *index, int tag, unsigned int nr_pages,
370 struct page **pages)
371{
372 return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag,
373 nr_pages, pages);
374}
371unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start, 375unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start,
372 int tag, unsigned int nr_entries, 376 int tag, unsigned int nr_entries,
373 struct page **entries, pgoff_t *indices); 377 struct page **entries, pgoff_t *indices);
@@ -616,6 +620,8 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
616extern void delete_from_page_cache(struct page *page); 620extern void delete_from_page_cache(struct page *page);
617extern void __delete_from_page_cache(struct page *page, void *shadow); 621extern void __delete_from_page_cache(struct page *page, void *shadow);
618int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask); 622int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask);
623void delete_from_page_cache_batch(struct address_space *mapping,
624 struct pagevec *pvec);
619 625
620/* 626/*
621 * Like add_to_page_cache_locked, but used to add newly allocated pages: 627 * Like add_to_page_cache_locked, but used to add newly allocated pages: