blob: 2ccd8f213fc4dabafe7603b08f5d5d51c2a86e71 [file] [log] [blame]
Matthew Wilcox (Oracle)2f525782020-12-10 10:55:05 -05001/*
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
Matthew Wilcox (Oracle)34170132021-05-07 07:28:40 -04007#include <linux/migrate.h>
Matthew Wilcox (Oracle)2f525782020-12-10 10:55:05 -05008#include <linux/pagemap.h>
Matthew Wilcox (Oracle)76580b62021-04-27 10:47:39 -04009#include <linux/swap.h>
Matthew Wilcox (Oracle)2f525782020-12-10 10:55:05 -050010
11struct address_space *page_mapping(struct page *page)
12{
13 return folio_mapping(page_folio(page));
14}
15EXPORT_SYMBOL(page_mapping);
Matthew Wilcox (Oracle)4e136422020-12-07 15:44:35 -050016
17void unlock_page(struct page *page)
18{
19 return folio_unlock(page_folio(page));
20}
21EXPORT_SYMBOL(unlock_page);
Matthew Wilcox (Oracle)4268b482021-03-03 15:21:55 -050022
23void end_page_writeback(struct page *page)
24{
25 return folio_end_writeback(page_folio(page));
26}
27EXPORT_SYMBOL(end_page_writeback);
Matthew Wilcox (Oracle)490e0162021-03-04 11:09:17 -050028
29void wait_on_page_writeback(struct page *page)
30{
31 return folio_wait_writeback(page_folio(page));
32}
33EXPORT_SYMBOL_GPL(wait_on_page_writeback);
Matthew Wilcox (Oracle)a49d0c52021-03-04 11:25:25 -050034
35void wait_for_stable_page(struct page *page)
36{
37 return folio_wait_stable(page_folio(page));
38}
39EXPORT_SYMBOL_GPL(wait_for_stable_page);
Matthew Wilcox (Oracle)dd10ab02021-04-12 16:45:17 -040040
41bool page_mapped(struct page *page)
42{
43 return folio_mapped(page_folio(page));
44}
45EXPORT_SYMBOL(page_mapped);
Matthew Wilcox (Oracle)76580b62021-04-27 10:47:39 -040046
47void mark_page_accessed(struct page *page)
48{
49 folio_mark_accessed(page_folio(page));
50}
51EXPORT_SYMBOL(mark_page_accessed);
Matthew Wilcox (Oracle)34170132021-05-07 07:28:40 -040052
53#ifdef CONFIG_MIGRATION
54int migrate_page_move_mapping(struct address_space *mapping,
55 struct page *newpage, struct page *page, int extra_count)
56{
57 return folio_migrate_mapping(mapping, page_folio(newpage),
58 page_folio(page), extra_count);
59}
60EXPORT_SYMBOL(migrate_page_move_mapping);
Matthew Wilcox (Oracle)19138342021-05-07 15:26:29 -040061
62void migrate_page_states(struct page *newpage, struct page *page)
63{
64 folio_migrate_flags(page_folio(newpage), page_folio(page));
65}
66EXPORT_SYMBOL(migrate_page_states);
Matthew Wilcox (Oracle)715cbfd2021-05-07 15:05:06 -040067
68void migrate_page_copy(struct page *newpage, struct page *page)
69{
70 folio_migrate_copy(page_folio(newpage), page_folio(page));
71}
72EXPORT_SYMBOL(migrate_page_copy);
Matthew Wilcox (Oracle)34170132021-05-07 07:28:40 -040073#endif