Lines Matching refs:page
121 void release_pages(struct page **pages, int nr);
167 static inline int __page_cache_add_speculative(struct page *page, int count) in __page_cache_add_speculative() argument
182 VM_BUG_ON_PAGE(page_count(page) == 0, page); in __page_cache_add_speculative()
183 page_ref_add(page, count); in __page_cache_add_speculative()
186 if (unlikely(!page_ref_add_unless(page, count, 0))) { in __page_cache_add_speculative()
195 VM_BUG_ON_PAGE(PageTail(page), page); in __page_cache_add_speculative()
200 static inline int page_cache_get_speculative(struct page *page) in page_cache_get_speculative() argument
202 return __page_cache_add_speculative(page, 1); in page_cache_get_speculative()
205 static inline int page_cache_add_speculative(struct page *page, int count) in page_cache_add_speculative() argument
207 return __page_cache_add_speculative(page, count); in page_cache_add_speculative()
211 extern struct page *__page_cache_alloc(gfp_t gfp);
213 static inline struct page *__page_cache_alloc(gfp_t gfp) in __page_cache_alloc()
219 static inline struct page *page_cache_alloc(struct address_space *x) in page_cache_alloc()
229 typedef int filler_t(void *, struct page *);
244 struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,
257 static inline struct page *find_get_page(struct address_space *mapping, in find_get_page()
263 static inline struct page *find_get_page_flags(struct address_space *mapping, in find_get_page_flags()
282 static inline struct page *find_lock_page(struct address_space *mapping, in find_lock_page()
307 static inline struct page *find_or_create_page(struct address_space *mapping, in find_or_create_page()
328 static inline struct page *grab_cache_page_nowait(struct address_space *mapping, in grab_cache_page_nowait()
336 static inline struct page *find_subpage(struct page *page, pgoff_t offset) in find_subpage() argument
338 if (PageHuge(page)) in find_subpage()
339 return page; in find_subpage()
341 VM_BUG_ON_PAGE(PageTail(page), page); in find_subpage()
343 return page + (offset & (compound_nr(page) - 1)); in find_subpage()
346 struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);
347 struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset);
349 unsigned int nr_entries, struct page **entries,
353 struct page **pages);
356 struct page **pages) in find_get_pages()
362 unsigned int nr_pages, struct page **pages);
365 struct page **pages);
368 struct page **pages) in find_get_pages_tag()
374 struct page *grab_cache_page_write_begin(struct address_space *mapping,
380 static inline struct page *grab_cache_page(struct address_space *mapping, in grab_cache_page()
386 extern struct page * read_cache_page(struct address_space *mapping,
388 extern struct page * read_cache_page_gfp(struct address_space *mapping,
393 static inline struct page *read_mapping_page(struct address_space *mapping, in read_mapping_page()
403 static inline pgoff_t page_to_index(struct page *page) in page_to_index() argument
407 if (likely(!PageTransTail(page))) in page_to_index()
408 return page->index; in page_to_index()
414 pgoff = compound_head(page)->index; in page_to_index()
415 pgoff += page - compound_head(page); in page_to_index()
423 static inline pgoff_t page_to_pgoff(struct page *page) in page_to_pgoff() argument
425 if (unlikely(PageHeadHuge(page))) in page_to_pgoff()
426 return page->index << compound_order(page); in page_to_pgoff()
428 return page_to_index(page); in page_to_pgoff()
434 static inline loff_t page_offset(struct page *page) in page_offset() argument
436 return ((loff_t)page->index) << PAGE_SHIFT; in page_offset()
439 static inline loff_t page_file_offset(struct page *page) in page_file_offset() argument
441 return ((loff_t)page_index(page)) << PAGE_SHIFT; in page_file_offset()
458 extern void __lock_page(struct page *page);
459 extern int __lock_page_killable(struct page *page);
460 extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
462 extern void unlock_page(struct page *page);
467 static inline int trylock_page(struct page *page) in trylock_page() argument
469 page = compound_head(page); in trylock_page()
470 return (likely(!test_and_set_bit_lock(PG_locked, &page->flags))); in trylock_page()
476 static inline void lock_page(struct page *page) in lock_page() argument
479 if (!trylock_page(page)) in lock_page()
480 __lock_page(page); in lock_page()
488 static inline int lock_page_killable(struct page *page) in lock_page_killable() argument
491 if (!trylock_page(page)) in lock_page_killable()
492 return __lock_page_killable(page); in lock_page_killable()
503 static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, in lock_page_or_retry() argument
507 return trylock_page(page) || __lock_page_or_retry(page, mm, flags); in lock_page_or_retry()
514 extern void wait_on_page_bit(struct page *page, int bit_nr);
515 extern int wait_on_page_bit_killable(struct page *page, int bit_nr);
524 static inline void wait_on_page_locked(struct page *page) in wait_on_page_locked() argument
526 if (PageLocked(page)) in wait_on_page_locked()
527 wait_on_page_bit(compound_head(page), PG_locked); in wait_on_page_locked()
530 static inline int wait_on_page_locked_killable(struct page *page) in wait_on_page_locked_killable() argument
532 if (!PageLocked(page)) in wait_on_page_locked_killable()
534 return wait_on_page_bit_killable(compound_head(page), PG_locked); in wait_on_page_locked_killable()
537 extern void put_and_wait_on_page_locked(struct page *page);
539 void wait_on_page_writeback(struct page *page);
540 extern void end_page_writeback(struct page *page);
541 void wait_for_stable_page(struct page *page);
543 void page_endio(struct page *page, bool is_write, int err);
548 extern void add_page_wait_queue(struct page *page, wait_queue_entry_t *waiter);
607 int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
609 int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
611 extern void delete_from_page_cache(struct page *page);
612 extern void __delete_from_page_cache(struct page *page, void *shadow);
613 int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask);
621 static inline int add_to_page_cache(struct page *page, in add_to_page_cache() argument
626 __SetPageLocked(page); in add_to_page_cache()
627 error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); in add_to_page_cache()
629 __ClearPageLocked(page); in add_to_page_cache()