summaryrefslogtreecommitdiff
path: root/mm/page_io.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-02-09 23:22:10 +0300
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-15 15:34:38 +0300
commit7e63df00cf5e609ebbee5ffbc3df1900d8a4443c (patch)
treee3350ffaed6685e7a6ae8a481772f5769cf5ab0d /mm/page_io.c
parent1f1d14dbc39a3e99b64322097893d7d147c0f466 (diff)
downloadlinux-7e63df00cf5e609ebbee5ffbc3df1900d8a4443c.tar.xz
mm: Convert swap_set_page_dirty() to swap_dirty_folio()
Straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs Tested-by: David Howells <dhowells@redhat.com> # afs
Diffstat (limited to 'mm/page_io.c')
-rw-r--r--mm/page_io.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index 24c975fb4e21..8f20f4dad289 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -438,19 +438,21 @@ out:
return ret;
}
-int swap_set_page_dirty(struct page *page)
+bool swap_dirty_folio(struct address_space *mapping, struct folio *folio)
{
- struct swap_info_struct *sis = page_swap_info(page);
+ struct swap_info_struct *sis = swp_swap_info(folio_swap_entry(folio));
if (data_race(sis->flags & SWP_FS_OPS)) {
- struct address_space *mapping = sis->swap_file->f_mapping;
- const struct address_space_operations *aops = mapping->a_ops;
+ const struct address_space_operations *aops;
+
+ mapping = sis->swap_file->f_mapping;
+ aops = mapping->a_ops;
- VM_BUG_ON_PAGE(!PageSwapCache(page), page);
+ VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
if (aops->dirty_folio)
- return aops->dirty_folio(mapping, page_folio(page));
- return aops->set_page_dirty(page);
+ return aops->dirty_folio(mapping, folio);
+ return aops->set_page_dirty(&folio->page);
} else {
- return __set_page_dirty_no_writeback(page);
+ return __set_page_dirty_no_writeback(&folio->page);
}
}