Skip to contentSkip to conversation

writeback-add-a-writeback-iterator.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Feb 24, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: writeback: add a writeback iterator
has been removed from the -mm tree. Its filename was
writeback-add-a-writeback-iterator.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Christoph Hellwig <[email protected]>
Subject: writeback: add a writeback iterator
Date: Thu, 15 Feb 2024 07:36:48 +0100

Refactor the code left in write_cache_pages into an iterator that the file system can call to get the next folio for a writeback operation:

	struct folio *folio = NULL;

	while ((folio = writeback_iter(mapping, wbc, folio, &error))) {
		error = <do per-folio writeback>;
	}

The twist here is that the error value is passed by reference, so that the iterator can restore it when breaking out of the loop.

Handling of the magic AOP_WRITEPAGE_ACTIVATE value stays outside the iterator and needs is just kept in the write_cache_pages legacy wrapper. in preparation for eventually killing it off.

Heavily based on a for_each* based iterator from Matthew Wilcox.

---

 include/linux/writeback.h |    4 
 mm/page-writeback.c       |  192 +++++++++++++++++++++---------------
 2 files changed, 118 insertions(+), 78 deletions(-)
include/linux/writeback.h renamed from include/linux/writeback.h~writeback-add-a-writeback-iterator +4 -0
@@ -82,6 +82,7 @@ struct writeback_control {
 	/* internal fields used by the ->writepages implementation: */
 	struct folio_batch fbatch;
 	pgoff_t index;
+	int saved_err;
 
 #ifdef CONFIG_CGROUP_WRITEBACK
 	struct bdi_writeback *wb;	/* wb this writeback is issued under */
@@ -366,6 +367,9 @@ int balance_dirty_pages_ratelimited_flag
 
 bool wb_over_bg_thresh(struct bdi_writeback *wb);
 
+struct folio *writeback_iter(struct address_space *mapping,
+		struct writeback_control *wbc, struct folio *folio, int *error);
+
 typedef int (*writepage_t)(struct folio *folio, struct writeback_control *wbc,
 				void *data);
 
mm/page-writeback.c renamed from mm/page-writeback.c~writeback-add-a-writeback-iterator +114 -78

234 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are