@@ -98,7 +98,7 @@ static struct vfsmount *shm_mnt __ro_after_init;
9898#define SHORT_SYMLINK_LEN 128
9999
100100/*
101- * shmem_fallocate communicates with shmem_fault or shmem_writepage via
101+ * shmem_fallocate communicates with shmem_fault or shmem_writeout via
102102 * inode->i_private (with i_rwsem making sure that it has only one user at
103103 * a time): we would prefer not to enlarge the shmem inode just for that.
104104 */
@@ -107,7 +107,7 @@ struct shmem_falloc {
107107 pgoff_t start ; /* start of range currently being fallocated */
108108 pgoff_t next ; /* the next page offset to be fallocated */
109109 pgoff_t nr_falloced ; /* how many new pages have been fallocated */
110- pgoff_t nr_unswapped ; /* how often writepage refused to swap out */
110+ pgoff_t nr_unswapped ; /* how often writeout refused to swap out */
111111};
112112
113113struct shmem_options {
@@ -446,7 +446,7 @@ static void shmem_recalc_inode(struct inode *inode, long alloced, long swapped)
446446 /*
447447 * Special case: whereas normally shmem_recalc_inode() is called
448448 * after i_mapping->nrpages has already been adjusted (up or down),
449- * shmem_writepage () has to raise swapped before nrpages is lowered -
449+ * shmem_writeout () has to raise swapped before nrpages is lowered -
450450 * to stop a racing shmem_recalc_inode() from thinking that a page has
451451 * been freed. Compensate here, to avoid the need for a followup call.
452452 */
@@ -1536,11 +1536,6 @@ int shmem_unuse(unsigned int type)
15361536 return error ;
15371537}
15381538
1539- static int shmem_writepage (struct page * page , struct writeback_control * wbc )
1540- {
1541- return shmem_writeout (page_folio (page ), wbc );
1542- }
1543-
15441539/**
15451540 * shmem_writeout - Write the folio to swap
15461541 * @folio: The folio to write
@@ -1558,13 +1553,6 @@ int shmem_writeout(struct folio *folio, struct writeback_control *wbc)
15581553 int nr_pages ;
15591554 bool split = false;
15601555
1561- /*
1562- * Our capabilities prevent regular writeback or sync from ever calling
1563- * shmem_writepage; but a stacking filesystem might use ->writepage of
1564- * its underlying filesystem, in which case tmpfs should write out to
1565- * swap only in response to memory pressure, and not for the writeback
1566- * threads or sync.
1567- */
15681556 if (WARN_ON_ONCE (!wbc -> for_reclaim ))
15691557 goto redirty ;
15701558
@@ -1653,7 +1641,7 @@ int shmem_writeout(struct folio *folio, struct writeback_control *wbc)
16531641
16541642 mutex_unlock (& shmem_swaplist_mutex );
16551643 BUG_ON (folio_mapped (folio ));
1656- return swap_writepage ( & folio -> page , wbc );
1644+ return swap_writeout ( folio , wbc );
16571645 }
16581646
16591647 list_del_init (& info -> swaplist );
@@ -3776,7 +3764,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
37763764 index -- ;
37773765
37783766 /*
3779- * Inform shmem_writepage () how far we have reached.
3767+ * Inform shmem_writeout () how far we have reached.
37803768 * No need for lock or barrier: we have the page lock.
37813769 */
37823770 if (!folio_test_uptodate (folio ))
@@ -5199,7 +5187,6 @@ static int shmem_error_remove_folio(struct address_space *mapping,
51995187}
52005188
52015189static const struct address_space_operations shmem_aops = {
5202- .writepage = shmem_writepage ,
52035190 .dirty_folio = noop_dirty_folio ,
52045191#ifdef CONFIG_TMPFS
52055192 .write_begin = shmem_write_begin ,
0 commit comments