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
This commit is contained in:
parent
1f1d14dbc3
commit
7e63df00cf
|
@ -427,7 +427,7 @@ extern int swap_writepage(struct page *page, struct writeback_control *wbc);
|
||||||
extern void end_swap_bio_write(struct bio *bio);
|
extern void end_swap_bio_write(struct bio *bio);
|
||||||
extern int __swap_writepage(struct page *page, struct writeback_control *wbc,
|
extern int __swap_writepage(struct page *page, struct writeback_control *wbc,
|
||||||
bio_end_io_t end_write_func);
|
bio_end_io_t end_write_func);
|
||||||
extern int swap_set_page_dirty(struct page *page);
|
bool swap_dirty_folio(struct address_space *mapping, struct folio *folio);
|
||||||
|
|
||||||
int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
|
int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
|
||||||
unsigned long nr_pages, sector_t start_block);
|
unsigned long nr_pages, sector_t start_block);
|
||||||
|
|
18
mm/page_io.c
18
mm/page_io.c
|
@ -438,19 +438,21 @@ int swap_readpage(struct page *page, bool synchronous)
|
||||||
return ret;
|
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)) {
|
if (data_race(sis->flags & SWP_FS_OPS)) {
|
||||||
struct address_space *mapping = sis->swap_file->f_mapping;
|
const struct address_space_operations *aops;
|
||||||
const struct address_space_operations *aops = mapping->a_ops;
|
|
||||||
|
|
||||||
VM_BUG_ON_PAGE(!PageSwapCache(page), page);
|
mapping = sis->swap_file->f_mapping;
|
||||||
|
aops = mapping->a_ops;
|
||||||
|
|
||||||
|
VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
|
||||||
if (aops->dirty_folio)
|
if (aops->dirty_folio)
|
||||||
return aops->dirty_folio(mapping, page_folio(page));
|
return aops->dirty_folio(mapping, folio);
|
||||||
return aops->set_page_dirty(page);
|
return aops->set_page_dirty(&folio->page);
|
||||||
} else {
|
} else {
|
||||||
return __set_page_dirty_no_writeback(page);
|
return __set_page_dirty_no_writeback(&folio->page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
static const struct address_space_operations swap_aops = {
|
static const struct address_space_operations swap_aops = {
|
||||||
.writepage = swap_writepage,
|
.writepage = swap_writepage,
|
||||||
.set_page_dirty = swap_set_page_dirty,
|
.dirty_folio = swap_dirty_folio,
|
||||||
#ifdef CONFIG_MIGRATION
|
#ifdef CONFIG_MIGRATION
|
||||||
.migratepage = migrate_page,
|
.migratepage = migrate_page,
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue