Skip to content

Commit 8e5ae38

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
writeback: Remove writeback_use_writepage()
The ->writepage operation has been removed from all filesystems but shmem and swap, neither of which call in here. Remove this alternative to calling ->writepages. Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 7ee3647 commit 8e5ae38

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

mm/page-writeback.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,27 +2621,6 @@ int write_cache_pages(struct address_space *mapping,
26212621
}
26222622
EXPORT_SYMBOL(write_cache_pages);
26232623

2624-
static int writeback_use_writepage(struct address_space *mapping,
2625-
struct writeback_control *wbc)
2626-
{
2627-
struct folio *folio = NULL;
2628-
struct blk_plug plug;
2629-
int err;
2630-
2631-
blk_start_plug(&plug);
2632-
while ((folio = writeback_iter(mapping, wbc, folio, &err))) {
2633-
err = mapping->a_ops->writepage(&folio->page, wbc);
2634-
if (err == AOP_WRITEPAGE_ACTIVATE) {
2635-
folio_unlock(folio);
2636-
err = 0;
2637-
}
2638-
mapping_set_error(mapping, err);
2639-
}
2640-
blk_finish_plug(&plug);
2641-
2642-
return err;
2643-
}
2644-
26452624
int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
26462625
{
26472626
int ret;
@@ -2652,14 +2631,11 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
26522631
wb = inode_to_wb_wbc(mapping->host, wbc);
26532632
wb_bandwidth_estimate_start(wb);
26542633
while (1) {
2655-
if (mapping->a_ops->writepages) {
2634+
if (mapping->a_ops->writepages)
26562635
ret = mapping->a_ops->writepages(mapping, wbc);
2657-
} else if (mapping->a_ops->writepage) {
2658-
ret = writeback_use_writepage(mapping, wbc);
2659-
} else {
2636+
else
26602637
/* deal with chardevs and other special files */
26612638
ret = 0;
2662-
}
26632639
if (ret != -ENOMEM || wbc->sync_mode != WB_SYNC_ALL)
26642640
break;
26652641

0 commit comments

Comments
 (0)