mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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:
18
mm/page_io.c
18
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;
|
||||
|
||||
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)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user