Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: remove write_cache_pages

No users left.

Link: https://lkml.kernel.org/r/20250818061017.1526853-4-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Andrew Morton
7bebb41b e34b21ba

-36
-6
include/linux/writeback.h
··· 360 360 struct folio *writeback_iter(struct address_space *mapping, 361 361 struct writeback_control *wbc, struct folio *folio, int *error); 362 362 363 - typedef int (*writepage_t)(struct folio *folio, struct writeback_control *wbc, 364 - void *data); 365 - 366 - int write_cache_pages(struct address_space *mapping, 367 - struct writeback_control *wbc, writepage_t writepage, 368 - void *data); 369 363 int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 370 364 void writeback_set_ratelimit(void); 371 365 void tag_pages_for_writeback(struct address_space *mapping,
-30
mm/page-writeback.c
··· 2590 2590 } 2591 2591 EXPORT_SYMBOL_GPL(writeback_iter); 2592 2592 2593 - /** 2594 - * write_cache_pages - walk the list of dirty pages of the given address space and write all of them. 2595 - * @mapping: address space structure to write 2596 - * @wbc: subtract the number of written pages from *@wbc->nr_to_write 2597 - * @writepage: function called for each page 2598 - * @data: data passed to writepage function 2599 - * 2600 - * Return: %0 on success, negative error code otherwise 2601 - * 2602 - * Note: please use writeback_iter() instead. 2603 - */ 2604 - int write_cache_pages(struct address_space *mapping, 2605 - struct writeback_control *wbc, writepage_t writepage, 2606 - void *data) 2607 - { 2608 - struct folio *folio = NULL; 2609 - int error; 2610 - 2611 - while ((folio = writeback_iter(mapping, wbc, folio, &error))) { 2612 - error = writepage(folio, wbc, data); 2613 - if (error == AOP_WRITEPAGE_ACTIVATE) { 2614 - folio_unlock(folio); 2615 - error = 0; 2616 - } 2617 - } 2618 - 2619 - return error; 2620 - } 2621 - EXPORT_SYMBOL(write_cache_pages); 2622 - 2623 2593 int do_writepages(struct address_space *mapping, struct writeback_control *wbc) 2624 2594 { 2625 2595 int ret;