~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/mm/folio-compat.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Compatibility functions which bloat the callers too much to make inline.
  3  * All of the callers of these functions should be converted to use folios
  4  * eventually.
  5  */
  6 
  7 #include <linux/migrate.h>
  8 #include <linux/pagemap.h>
  9 #include <linux/rmap.h>
 10 #include <linux/swap.h>
 11 #include "internal.h"
 12 
 13 void unlock_page(struct page *page)
 14 {
 15         return folio_unlock(page_folio(page));
 16 }
 17 EXPORT_SYMBOL(unlock_page);
 18 
 19 void end_page_writeback(struct page *page)
 20 {
 21         return folio_end_writeback(page_folio(page));
 22 }
 23 EXPORT_SYMBOL(end_page_writeback);
 24 
 25 void wait_on_page_writeback(struct page *page)
 26 {
 27         return folio_wait_writeback(page_folio(page));
 28 }
 29 EXPORT_SYMBOL_GPL(wait_on_page_writeback);
 30 
 31 void wait_for_stable_page(struct page *page)
 32 {
 33         return folio_wait_stable(page_folio(page));
 34 }
 35 EXPORT_SYMBOL_GPL(wait_for_stable_page);
 36 
 37 void mark_page_accessed(struct page *page)
 38 {
 39         folio_mark_accessed(page_folio(page));
 40 }
 41 EXPORT_SYMBOL(mark_page_accessed);
 42 
 43 void set_page_writeback(struct page *page)
 44 {
 45         folio_start_writeback(page_folio(page));
 46 }
 47 EXPORT_SYMBOL(set_page_writeback);
 48 
 49 bool set_page_dirty(struct page *page)
 50 {
 51         return folio_mark_dirty(page_folio(page));
 52 }
 53 EXPORT_SYMBOL(set_page_dirty);
 54 
 55 bool clear_page_dirty_for_io(struct page *page)
 56 {
 57         return folio_clear_dirty_for_io(page_folio(page));
 58 }
 59 EXPORT_SYMBOL(clear_page_dirty_for_io);
 60 
 61 bool redirty_page_for_writepage(struct writeback_control *wbc,
 62                 struct page *page)
 63 {
 64         return folio_redirty_for_writepage(wbc, page_folio(page));
 65 }
 66 EXPORT_SYMBOL(redirty_page_for_writepage);
 67 
 68 int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
 69                 pgoff_t index, gfp_t gfp)
 70 {
 71         return filemap_add_folio(mapping, page_folio(page), index, gfp);
 72 }
 73 EXPORT_SYMBOL(add_to_page_cache_lru);
 74 
 75 noinline
 76 struct page *pagecache_get_page(struct address_space *mapping, pgoff_t index,
 77                 fgf_t fgp_flags, gfp_t gfp)
 78 {
 79         struct folio *folio;
 80 
 81         folio = __filemap_get_folio(mapping, index, fgp_flags, gfp);
 82         if (IS_ERR(folio))
 83                 return NULL;
 84         return folio_file_page(folio, index);
 85 }
 86 EXPORT_SYMBOL(pagecache_get_page);
 87 
 88 struct page *grab_cache_page_write_begin(struct address_space *mapping,
 89                                         pgoff_t index)
 90 {
 91         return pagecache_get_page(mapping, index, FGP_WRITEBEGIN,
 92                         mapping_gfp_mask(mapping));
 93 }
 94 EXPORT_SYMBOL(grab_cache_page_write_begin);
 95 
 96 bool isolate_lru_page(struct page *page)
 97 {
 98         if (WARN_RATELIMIT(PageTail(page), "trying to isolate tail page"))
 99                 return false;
100         return folio_isolate_lru((struct folio *)page);
101 }
102 
103 void putback_lru_page(struct page *page)
104 {
105         folio_putback_lru(page_folio(page));
106 }
107 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php