@@ -1536,12 +1536,20 @@ int shmem_unuse(unsigned int type)
1536
1536
return error ;
1537
1537
}
1538
1538
1539
- /*
1540
- * Move the page from the page cache to the swap cache.
1541
- */
1542
1539
static int shmem_writepage (struct page * page , struct writeback_control * wbc )
1543
1540
{
1544
- struct folio * folio = page_folio (page );
1541
+ return shmem_writeout (page_folio (page ), wbc );
1542
+ }
1543
+
1544
+ /**
1545
+ * shmem_writeout - Write the folio to swap
1546
+ * @folio: The folio to write
1547
+ * @wbc: How writeback is to be done
1548
+ *
1549
+ * Move the folio from the page cache to the swap cache.
1550
+ */
1551
+ int shmem_writeout (struct folio * folio , struct writeback_control * wbc )
1552
+ {
1545
1553
struct address_space * mapping = folio -> mapping ;
1546
1554
struct inode * inode = mapping -> host ;
1547
1555
struct shmem_inode_info * info = SHMEM_I (inode );
@@ -1586,9 +1594,8 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
1586
1594
try_split :
1587
1595
/* Ensure the subpages are still dirty */
1588
1596
folio_test_set_dirty (folio );
1589
- if (split_huge_page_to_list_to_order ( page , wbc -> list , 0 ))
1597
+ if (split_folio_to_list ( folio , wbc -> list ))
1590
1598
goto redirty ;
1591
- folio = page_folio (page );
1592
1599
folio_clear_dirty (folio );
1593
1600
}
1594
1601
@@ -1660,6 +1667,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
1660
1667
folio_unlock (folio );
1661
1668
return 0 ;
1662
1669
}
1670
+ EXPORT_SYMBOL_GPL (shmem_writeout );
1663
1671
1664
1672
#if defined(CONFIG_NUMA ) && defined(CONFIG_TMPFS )
1665
1673
static void shmem_show_mpol (struct seq_file * seq , struct mempolicy * mpol )
0 commit comments