linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] Clean up the writeback paths
@ 2023-12-15 20:02 Matthew Wilcox (Oracle)
  2023-12-15 20:02 ` [PATCH 01/14] fs: Remove clean_page_buffers() Matthew Wilcox (Oracle)
                   ` (14 more replies)
  0 siblings, 15 replies; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

I don't think any of this conflicts with the writeback refactoring that
Christoph has kindly taken over from me, although we might want to redo
patch 13 on that infrastructure rather than using write_cache_pages().
That can be a later addition.

Most of these patches verge on the trivial, converting filesystems that
just use block_write_full_page() to use mpage_writepages().  But as we
saw with Christoph's earlier patchset, there can be some "interesting"
gotchas, and I clearly haven't tested the majority of filesystems I've
touched here.

Patches 3 & 4 get rid of a lot of stack usage on architectures with
larger page sizes; 1024 bytes on 64-bit systems with 64KiB pages.
It starts to open the door to larger folio sizes on all architectures,
but it's certainly not enough yet.

Patch 14 is kind of trivial, but it's nice to get that simplification in.

Matthew Wilcox (Oracle) (14):
  fs: Remove clean_page_buffers()
  fs: Convert clean_buffers() to take a folio
  fs: Reduce stack usage in __mpage_writepage
  fs: Reduce stack usage in do_mpage_readpage
  adfs: Remove writepage implementation
  bfs: Remove writepage implementation
  hfs: Really remove hfs_writepage
  hfsplus: Really remove hfsplus_writepage
  minix: Remove writepage implementation
  ocfs2: Remove writepage implementation
  sysv: Remove writepage implementation
  ufs: Remove writepage implementation
  fs: Convert block_write_full_page to block_write_full_folio
  fs: Remove the bh_end_io argument from __block_write_full_folio

 block/fops.c                | 21 +++++++++++--
 fs/adfs/inode.c             | 11 ++++---
 fs/bfs/file.c               |  9 ++++--
 fs/buffer.c                 | 36 ++++++++++-----------
 fs/ext4/page-io.c           |  2 +-
 fs/gfs2/aops.c              |  6 ++--
 fs/hfs/inode.c              |  8 ++---
 fs/hfsplus/inode.c          |  8 ++---
 fs/minix/inode.c            |  9 ++++--
 fs/mpage.c                  | 62 +++++++++++++++++--------------------
 fs/ntfs/aops.c              |  4 +--
 fs/ocfs2/alloc.c            |  2 +-
 fs/ocfs2/aops.c             | 15 ++++-----
 fs/ocfs2/file.c             |  2 +-
 fs/ocfs2/ocfs2_trace.h      |  2 --
 fs/sysv/itree.c             |  9 ++++--
 fs/ufs/inode.c              | 11 ++++---
 include/linux/buffer_head.h |  9 ++----
 18 files changed, 115 insertions(+), 111 deletions(-)

-- 
2.42.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/14] fs: Remove clean_page_buffers()
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:27   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 02/14] fs: Convert clean_buffers() to take a folio Matthew Wilcox (Oracle)
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

This function has been unused since the removal of bdev_write_page().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/mpage.c                  | 10 ----------
 include/linux/buffer_head.h |  1 -
 2 files changed, 11 deletions(-)

diff --git a/fs/mpage.c b/fs/mpage.c
index ffb064ed9d04..63bf99856024 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -455,16 +455,6 @@ static void clean_buffers(struct page *page, unsigned first_unmapped)
 		try_to_free_buffers(page_folio(page));
 }
 
-/*
- * For situations where we want to clean all buffers attached to a page.
- * We don't need to calculate how many buffers are attached to the page,
- * we just need to specify a number larger than the maximum number of buffers.
- */
-void clean_page_buffers(struct page *page)
-{
-	clean_buffers(page, ~0U);
-}
-
 static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 		      void *data)
 {
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5f23ee599889..94f6161eb45e 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -270,7 +270,6 @@ int generic_write_end(struct file *, struct address_space *,
 				loff_t, unsigned, unsigned,
 				struct page *, void *);
 void folio_zero_new_buffers(struct folio *folio, size_t from, size_t to);
-void clean_page_buffers(struct page *page);
 int cont_write_begin(struct file *, struct address_space *, loff_t,
 			unsigned, struct page **, void **,
 			get_block_t *, loff_t *);
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 02/14] fs: Convert clean_buffers() to take a folio
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
  2023-12-15 20:02 ` [PATCH 01/14] fs: Remove clean_page_buffers() Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:27   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage Matthew Wilcox (Oracle)
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

The only caller already has a folio, so pass it in and use it throughout.
Saves two calls to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/mpage.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/mpage.c b/fs/mpage.c
index 63bf99856024..630f4a7c7d03 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -430,13 +430,13 @@ struct mpage_data {
  * We have our BIO, so we can now mark the buffers clean.  Make
  * sure to only clean buffers which we know we'll be writing.
  */
-static void clean_buffers(struct page *page, unsigned first_unmapped)
+static void clean_buffers(struct folio *folio, unsigned first_unmapped)
 {
 	unsigned buffer_counter = 0;
-	struct buffer_head *bh, *head;
-	if (!page_has_buffers(page))
+	struct buffer_head *bh, *head = folio_buffers(folio);
+
+	if (!head)
 		return;
-	head = page_buffers(page);
 	bh = head;
 
 	do {
@@ -451,8 +451,8 @@ static void clean_buffers(struct page *page, unsigned first_unmapped)
 	 * read_folio would fail to serialize with the bh and it would read from
 	 * disk before we reach the platter.
 	 */
-	if (buffer_heads_over_limit && PageUptodate(page))
-		try_to_free_buffers(page_folio(page));
+	if (buffer_heads_over_limit && folio_test_uptodate(folio))
+		try_to_free_buffers(folio);
 }
 
 static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
@@ -615,7 +615,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 		goto alloc_new;
 	}
 
-	clean_buffers(&folio->page, first_unmapped);
+	clean_buffers(folio, first_unmapped);
 
 	BUG_ON(folio_test_writeback(folio));
 	folio_start_writeback(folio);
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
  2023-12-15 20:02 ` [PATCH 01/14] fs: Remove clean_page_buffers() Matthew Wilcox (Oracle)
  2023-12-15 20:02 ` [PATCH 02/14] fs: Convert clean_buffers() to take a folio Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:29   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage Matthew Wilcox (Oracle)
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

Some architectures support a very large PAGE_SIZE, so instead of the 8
pointers we see with a 4kB PAGE_SIZE, we can see 128 pointers with 64kB
or so many on Hexagon that it trips compiler warnings about exceeding
stack frame size.

All we're doing with this array is checking for block contiguity, which we
can as well do by remembering the address of the first block in the page
and checking this block is at the appropriate offset from that address.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/mpage.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/fs/mpage.c b/fs/mpage.c
index 630f4a7c7d03..84b02098e7a5 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -466,7 +466,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 	const unsigned blocks_per_page = PAGE_SIZE >> blkbits;
 	sector_t last_block;
 	sector_t block_in_file;
-	sector_t blocks[MAX_BUF_PER_PAGE];
+	sector_t first_block;
 	unsigned page_block;
 	unsigned first_unmapped = blocks_per_page;
 	struct block_device *bdev = NULL;
@@ -504,10 +504,12 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 			if (!buffer_dirty(bh) || !buffer_uptodate(bh))
 				goto confused;
 			if (page_block) {
-				if (bh->b_blocknr != blocks[page_block-1] + 1)
+				if (bh->b_blocknr != first_block + page_block)
 					goto confused;
+			} else {
+				first_block = bh->b_blocknr;
 			}
-			blocks[page_block++] = bh->b_blocknr;
+			page_block++;
 			boundary = buffer_boundary(bh);
 			if (boundary) {
 				boundary_block = bh->b_blocknr;
@@ -556,10 +558,12 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 			boundary_bdev = map_bh.b_bdev;
 		}
 		if (page_block) {
-			if (map_bh.b_blocknr != blocks[page_block-1] + 1)
+			if (map_bh.b_blocknr != first_block + page_block)
 				goto confused;
+		} else {
+			first_block = map_bh.b_blocknr;
 		}
-		blocks[page_block++] = map_bh.b_blocknr;
+		page_block++;
 		boundary = buffer_boundary(&map_bh);
 		bdev = map_bh.b_bdev;
 		if (block_in_file == last_block)
@@ -591,7 +595,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 	/*
 	 * This page will go to BIO.  Do we need to send this BIO off first?
 	 */
-	if (bio && mpd->last_block_in_bio != blocks[0] - 1)
+	if (bio && mpd->last_block_in_bio != first_block - 1)
 		bio = mpage_bio_submit_write(bio);
 
 alloc_new:
@@ -599,7 +603,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 		bio = bio_alloc(bdev, BIO_MAX_VECS,
 				REQ_OP_WRITE | wbc_to_write_flags(wbc),
 				GFP_NOFS);
-		bio->bi_iter.bi_sector = blocks[0] << (blkbits - 9);
+		bio->bi_iter.bi_sector = first_block << (blkbits - 9);
 		wbc_init_bio(wbc, bio);
 	}
 
@@ -627,7 +631,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 					boundary_block, 1 << blkbits);
 		}
 	} else {
-		mpd->last_block_in_bio = blocks[blocks_per_page - 1];
+		mpd->last_block_in_bio = first_block + blocks_per_page - 1;
 	}
 	goto out;
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (2 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:29   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 05/14] adfs: Remove writepage implementation Matthew Wilcox (Oracle)
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

Some architectures support a very large PAGE_SIZE, so instead of the 8
pointers we see with a 4kB PAGE_SIZE, we can see 128 pointers with 64kB
or so many on Hexagon that it trips compiler warnings about exceeding
stack frame size.

All we're doing with this array is checking for block contiguity, which we
can as well do by remembering the address of the first block in the page
and checking this block is at the appropriate offset from that address.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/mpage.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/mpage.c b/fs/mpage.c
index 84b02098e7a5..d4963f3d8051 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -166,7 +166,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 	sector_t block_in_file;
 	sector_t last_block;
 	sector_t last_block_in_file;
-	sector_t blocks[MAX_BUF_PER_PAGE];
+	sector_t first_block;
 	unsigned page_block;
 	unsigned first_hole = blocks_per_page;
 	struct block_device *bdev = NULL;
@@ -205,6 +205,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 		unsigned map_offset = block_in_file - args->first_logical_block;
 		unsigned last = nblocks - map_offset;
 
+		first_block = map_bh->b_blocknr + map_offset;
 		for (relative_block = 0; ; relative_block++) {
 			if (relative_block == last) {
 				clear_buffer_mapped(map_bh);
@@ -212,8 +213,6 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 			}
 			if (page_block == blocks_per_page)
 				break;
-			blocks[page_block] = map_bh->b_blocknr + map_offset +
-						relative_block;
 			page_block++;
 			block_in_file++;
 		}
@@ -259,7 +258,9 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 			goto confused;		/* hole -> non-hole */
 
 		/* Contiguous blocks? */
-		if (page_block && blocks[page_block-1] != map_bh->b_blocknr-1)
+		if (!page_block)
+			first_block = map_bh->b_blocknr;
+		else if (first_block + page_block != map_bh->b_blocknr)
 			goto confused;
 		nblocks = map_bh->b_size >> blkbits;
 		for (relative_block = 0; ; relative_block++) {
@@ -268,7 +269,6 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 				break;
 			} else if (page_block == blocks_per_page)
 				break;
-			blocks[page_block] = map_bh->b_blocknr+relative_block;
 			page_block++;
 			block_in_file++;
 		}
@@ -289,7 +289,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 	/*
 	 * This folio will go to BIO.  Do we need to send this BIO off first?
 	 */
-	if (args->bio && (args->last_block_in_bio != blocks[0] - 1))
+	if (args->bio && (args->last_block_in_bio != first_block - 1))
 		args->bio = mpage_bio_submit_read(args->bio);
 
 alloc_new:
@@ -298,7 +298,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 				      gfp);
 		if (args->bio == NULL)
 			goto confused;
-		args->bio->bi_iter.bi_sector = blocks[0] << (blkbits - 9);
+		args->bio->bi_iter.bi_sector = first_block << (blkbits - 9);
 	}
 
 	length = first_hole << blkbits;
@@ -313,7 +313,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
 	    (first_hole != blocks_per_page))
 		args->bio = mpage_bio_submit_read(args->bio);
 	else
-		args->last_block_in_bio = blocks[blocks_per_page - 1];
+		args->last_block_in_bio = first_block + blocks_per_page - 1;
 out:
 	return args->bio;
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 05/14] adfs: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (3 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:31   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 06/14] bfs: " Matthew Wilcox (Oracle)
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/adfs/inode.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 3081edb09e46..a183e213a4a5 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -5,6 +5,7 @@
  *  Copyright (C) 1997-1999 Russell King
  */
 #include <linux/buffer_head.h>
+#include <linux/mpage.h>
 #include <linux/writeback.h>
 #include "adfs.h"
 
@@ -33,9 +34,10 @@ adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh,
 	return 0;
 }
 
-static int adfs_writepage(struct page *page, struct writeback_control *wbc)
+static int adfs_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page, adfs_get_block, wbc);
+	return mpage_writepages(mapping, wbc, adfs_get_block);
 }
 
 static int adfs_read_folio(struct file *file, struct folio *folio)
@@ -76,10 +78,11 @@ static const struct address_space_operations adfs_aops = {
 	.dirty_folio	= block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio	= adfs_read_folio,
-	.writepage	= adfs_writepage,
+	.writepages	= adfs_writepages,
 	.write_begin	= adfs_write_begin,
 	.write_end	= generic_write_end,
-	.bmap		= _adfs_bmap
+	.migrate_folio	= buffer_migrate_folio,
+	.bmap		= _adfs_bmap,
 };
 
 /*
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 06/14] bfs: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (4 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 05/14] adfs: Remove writepage implementation Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-17 16:48   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 07/14] hfs: Really remove hfs_writepage Matthew Wilcox (Oracle)
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/bfs/file.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index adc2230079c6..a778411574a9 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -11,6 +11,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/mpage.h>
 #include <linux/buffer_head.h>
 #include "bfs.h"
 
@@ -150,9 +151,10 @@ static int bfs_get_block(struct inode *inode, sector_t block,
 	return err;
 }
 
-static int bfs_writepage(struct page *page, struct writeback_control *wbc)
+static int bfs_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page, bfs_get_block, wbc);
+	return mpage_writepages(mapping, wbc, bfs_get_block);
 }
 
 static int bfs_read_folio(struct file *file, struct folio *folio)
@@ -190,9 +192,10 @@ const struct address_space_operations bfs_aops = {
 	.dirty_folio	= block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio	= bfs_read_folio,
-	.writepage	= bfs_writepage,
+	.writepages	= bfs_writepages,
 	.write_begin	= bfs_write_begin,
 	.write_end	= generic_write_end,
+	.migrate_folio	= buffer_migrate_folio,
 	.bmap		= bfs_bmap,
 };
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 07/14] hfs: Really remove hfs_writepage
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (5 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 06/14] bfs: " Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-18  4:31   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 08/14] hfsplus: Really remove hfsplus_writepage Matthew Wilcox (Oracle)
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

The earlier commit to remove hfs_writepage only removed it from
one of the aops.  Remove it from the btree_aops as well.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/hfs/inode.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index a7bc4690a780..8c34798a0715 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -29,11 +29,6 @@ static const struct inode_operations hfs_file_inode_operations;
 
 #define HFS_VALID_MODE_BITS  (S_IFREG | S_IFDIR | S_IRWXUGO)
 
-static int hfs_writepage(struct page *page, struct writeback_control *wbc)
-{
-	return block_write_full_page(page, hfs_get_block, wbc);
-}
-
 static int hfs_read_folio(struct file *file, struct folio *folio)
 {
 	return block_read_full_folio(folio, hfs_get_block);
@@ -162,9 +157,10 @@ const struct address_space_operations hfs_btree_aops = {
 	.dirty_folio	= block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio	= hfs_read_folio,
-	.writepage	= hfs_writepage,
+	.writepages	= hfs_writepages,
 	.write_begin	= hfs_write_begin,
 	.write_end	= generic_write_end,
+	.migrate_folio	= buffer_migrate_folio,
 	.bmap		= hfs_bmap,
 	.release_folio	= hfs_release_folio,
 };
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (6 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 07/14] hfs: Really remove hfs_writepage Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:33   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 09/14] minix: Remove writepage implementation Matthew Wilcox (Oracle)
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

The earlier commit to remove hfsplus_writepage only removed it from
one of the aops.  Remove it from the btree_aops as well.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/hfsplus/inode.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 702a0663b1d8..3d326926c195 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -28,11 +28,6 @@ static int hfsplus_read_folio(struct file *file, struct folio *folio)
 	return block_read_full_folio(folio, hfsplus_get_block);
 }
 
-static int hfsplus_writepage(struct page *page, struct writeback_control *wbc)
-{
-	return block_write_full_page(page, hfsplus_get_block, wbc);
-}
-
 static void hfsplus_write_failed(struct address_space *mapping, loff_t to)
 {
 	struct inode *inode = mapping->host;
@@ -159,9 +154,10 @@ const struct address_space_operations hfsplus_btree_aops = {
 	.dirty_folio	= block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio	= hfsplus_read_folio,
-	.writepage	= hfsplus_writepage,
+	.writepages	= hfsplus_writepages,
 	.write_begin	= hfsplus_write_begin,
 	.write_end	= generic_write_end,
+	.migrate_folio	= buffer_migrate_folio,
 	.bmap		= hfsplus_bmap,
 	.release_folio	= hfsplus_release_folio,
 };
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 09/14] minix: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (7 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 08/14] hfsplus: Really remove hfsplus_writepage Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-17 16:48   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 10/14] ocfs2: " Matthew Wilcox (Oracle)
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/minix/inode.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index f8af6c3ae336..73f37f298087 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -17,6 +17,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/highuid.h>
+#include <linux/mpage.h>
 #include <linux/vfs.h>
 #include <linux/writeback.h>
 
@@ -397,9 +398,10 @@ static int minix_get_block(struct inode *inode, sector_t block,
 		return V2_minix_get_block(inode, block, bh_result, create);
 }
 
-static int minix_writepage(struct page *page, struct writeback_control *wbc)
+static int minix_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page, minix_get_block, wbc);
+	return mpage_writepages(mapping, wbc, minix_get_block);
 }
 
 static int minix_read_folio(struct file *file, struct folio *folio)
@@ -444,9 +446,10 @@ static const struct address_space_operations minix_aops = {
 	.dirty_folio	= block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio = minix_read_folio,
-	.writepage = minix_writepage,
+	.writepages = minix_writepages,
 	.write_begin = minix_write_begin,
 	.write_end = generic_write_end,
+	.migrate_folio = buffer_migrate_folio,
 	.bmap = minix_bmap,
 	.direct_IO = noop_direct_IO
 };
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 10/14] ocfs2: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (8 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 09/14] minix: Remove writepage implementation Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:34   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 11/14] sysv: " Matthew Wilcox (Oracle)
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/ocfs2/aops.c        | 15 ++++++---------
 fs/ocfs2/ocfs2_trace.h |  2 --
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 795997806326..b82185075de7 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -389,21 +389,18 @@ static void ocfs2_readahead(struct readahead_control *rac)
 /* Note: Because we don't support holes, our allocation has
  * already happened (allocation writes zeros to the file data)
  * so we don't have to worry about ordered writes in
- * ocfs2_writepage.
+ * ocfs2_writepages.
  *
- * ->writepage is called during the process of invalidating the page cache
+ * ->writepages is called during the process of invalidating the page cache
  * during blocked lock processing.  It can't block on any cluster locks
  * to during block mapping.  It's relying on the fact that the block
  * mapping can't have disappeared under the dirty pages that it is
  * being asked to write back.
  */
-static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
+static int ocfs2_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	trace_ocfs2_writepage(
-		(unsigned long long)OCFS2_I(page->mapping->host)->ip_blkno,
-		page->index);
-
-	return block_write_full_page(page, ocfs2_get_block, wbc);
+	return mpage_writepages(mapping, wbc, ocfs2_get_block);
 }
 
 /* Taken from ext3. We don't necessarily need the full blown
@@ -2471,7 +2468,7 @@ const struct address_space_operations ocfs2_aops = {
 	.dirty_folio		= block_dirty_folio,
 	.read_folio		= ocfs2_read_folio,
 	.readahead		= ocfs2_readahead,
-	.writepage		= ocfs2_writepage,
+	.writepages		= ocfs2_writepages,
 	.write_begin		= ocfs2_write_begin,
 	.write_end		= ocfs2_write_end,
 	.bmap			= ocfs2_bmap,
diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index ac4fd1d5b128..9898c11bdfa1 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -1157,8 +1157,6 @@ DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_get_block_end);
 
 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_readpage);
 
-DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_writepage);
-
 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_bmap);
 
 TRACE_EVENT(ocfs2_try_to_write_inline_data,
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 11/14] sysv: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (9 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 10/14] ocfs2: " Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-17 16:48   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 12/14] ufs: " Matthew Wilcox (Oracle)
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/sysv/itree.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c
index 725981474e5f..410ab2a44d2f 100644
--- a/fs/sysv/itree.c
+++ b/fs/sysv/itree.c
@@ -8,6 +8,7 @@
 
 #include <linux/buffer_head.h>
 #include <linux/mount.h>
+#include <linux/mpage.h>
 #include <linux/string.h>
 #include "sysv.h"
 
@@ -456,9 +457,10 @@ int sysv_getattr(struct mnt_idmap *idmap, const struct path *path,
 	return 0;
 }
 
-static int sysv_writepage(struct page *page, struct writeback_control *wbc)
+static int sysv_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page,get_block,wbc);
+	return mpage_writepages(mapping, wbc, get_block);
 }
 
 static int sysv_read_folio(struct file *file, struct folio *folio)
@@ -503,8 +505,9 @@ const struct address_space_operations sysv_aops = {
 	.dirty_folio = block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio = sysv_read_folio,
-	.writepage = sysv_writepage,
+	.writepages = sysv_writepages,
 	.write_begin = sysv_write_begin,
 	.write_end = generic_write_end,
+	.migrate_folio = buffer_migrate_folio,
 	.bmap = sysv_bmap
 };
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 12/14] ufs: Remove writepage implementation
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (10 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 11/14] sysv: " Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:34   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio Matthew Wilcox (Oracle)
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/ufs/inode.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index ebce93b08281..a7bb2e63cdde 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -35,6 +35,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/buffer_head.h>
+#include <linux/mpage.h>
 #include <linux/writeback.h>
 #include <linux/iversion.h>
 
@@ -390,7 +391,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block,
 
 /**
  * ufs_getfrag_block() - `get_block_t' function, interface between UFS and
- * read_folio, writepage and so on
+ * read_folio, writepages and so on
  */
 
 static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create)
@@ -467,9 +468,10 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff
 	return 0;
 }
 
-static int ufs_writepage(struct page *page, struct writeback_control *wbc)
+static int ufs_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page,ufs_getfrag_block,wbc);
+	return mpage_writepages(mapping, wbc, ufs_getfrag_block);
 }
 
 static int ufs_read_folio(struct file *file, struct folio *folio)
@@ -528,9 +530,10 @@ const struct address_space_operations ufs_aops = {
 	.dirty_folio = block_dirty_folio,
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio = ufs_read_folio,
-	.writepage = ufs_writepage,
+	.writepages = ufs_writepages,
 	.write_begin = ufs_write_begin,
 	.write_end = ufs_write_end,
+	.migrate_folio = buffer_migrate_folio,
 	.bmap = ufs_bmap
 };
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (11 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 12/14] ufs: " Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-16  4:35   ` Christoph Hellwig
  2023-12-15 20:02 ` [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio Matthew Wilcox (Oracle)
  2023-12-16 20:51 ` [PATCH 00/14] Clean up the writeback paths Jens Axboe
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

Convert the function to be compatible with writepage_t so that it
can be passed to write_cache_pages() by blkdev.  This removes a call
to compound_head().  We can also remove the function export as both
callers are built-in.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 block/fops.c                | 21 ++++++++++++++++++---
 fs/buffer.c                 | 16 +++++++---------
 fs/ext4/page-io.c           |  2 +-
 fs/gfs2/aops.c              |  4 ++--
 fs/mpage.c                  |  2 +-
 fs/ntfs/aops.c              |  4 ++--
 fs/ocfs2/alloc.c            |  2 +-
 fs/ocfs2/file.c             |  2 +-
 include/linux/buffer_head.h |  4 ++--
 9 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/block/fops.c b/block/fops.c
index 0bdad1e8d514..0cf8cf72cdfa 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -410,9 +410,24 @@ static int blkdev_get_block(struct inode *inode, sector_t iblock,
 	return 0;
 }
 
-static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
+/*
+ * We cannot call mpage_writepages() as it does not take the buffer lock.
+ * We must use block_write_full_folio() directly which holds the buffer
+ * lock.  The buffer lock provides the synchronisation with writeback
+ * that filesystems rely on when they use the blockdev's mapping.
+ */
+static int blkdev_writepages(struct address_space *mapping,
+		struct writeback_control *wbc)
 {
-	return block_write_full_page(page, blkdev_get_block, wbc);
+	struct blk_plug plug;
+	int err;
+
+	blk_start_plug(&plug);
+	err = write_cache_pages(mapping, wbc, block_write_full_folio,
+			blkdev_get_block);
+	blk_finish_plug(&plug);
+
+	return err;
 }
 
 static int blkdev_read_folio(struct file *file, struct folio *folio)
@@ -449,7 +464,7 @@ const struct address_space_operations def_blk_aops = {
 	.invalidate_folio = block_invalidate_folio,
 	.read_folio	= blkdev_read_folio,
 	.readahead	= blkdev_readahead,
-	.writepage	= blkdev_writepage,
+	.writepages	= blkdev_writepages,
 	.write_begin	= blkdev_write_begin,
 	.write_end	= blkdev_write_end,
 	.migrate_folio	= buffer_migrate_folio_norefs,
diff --git a/fs/buffer.c b/fs/buffer.c
index 9f41d2b38902..2e69f0ddca37 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -372,7 +372,7 @@ static void end_buffer_async_read_io(struct buffer_head *bh, int uptodate)
 }
 
 /*
- * Completion handler for block_write_full_page() - pages which are unlocked
+ * Completion handler for block_write_full_folio() - pages which are unlocked
  * during I/O, and which have PageWriteback cleared upon I/O completion.
  */
 void end_buffer_async_write(struct buffer_head *bh, int uptodate)
@@ -1771,18 +1771,18 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
  */
 
 /*
- * While block_write_full_page is writing back the dirty buffers under
+ * While block_write_full_folio is writing back the dirty buffers under
  * the page lock, whoever dirtied the buffers may decide to clean them
  * again at any time.  We handle that by only looking at the buffer
  * state inside lock_buffer().
  *
- * If block_write_full_page() is called for regular writeback
+ * If block_write_full_folio() is called for regular writeback
  * (wbc->sync_mode == WB_SYNC_NONE) then it will redirty a page which has a
  * locked buffer.   This only can happen if someone has written the buffer
  * directly, with submit_bh().  At the address_space level PageWriteback
  * prevents this contention from occurring.
  *
- * If block_write_full_page() is called with wbc->sync_mode ==
+ * If block_write_full_folio() is called with wbc->sync_mode ==
  * WB_SYNC_ALL, the writes are posted using REQ_SYNC; this
  * causes the writes to be flagged as synchronous writes.
  */
@@ -1829,7 +1829,7 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
 			 * truncate in progress.
 			 */
 			/*
-			 * The buffer was zeroed by block_write_full_page()
+			 * The buffer was zeroed by block_write_full_folio()
 			 */
 			clear_buffer_dirty(bh);
 			set_buffer_uptodate(bh);
@@ -2696,10 +2696,9 @@ EXPORT_SYMBOL(block_truncate_page);
 /*
  * The generic ->writepage function for buffer-backed address_spaces
  */
-int block_write_full_page(struct page *page, get_block_t *get_block,
-			struct writeback_control *wbc)
+int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
+		void *get_block)
 {
-	struct folio *folio = page_folio(page);
 	struct inode * const inode = folio->mapping->host;
 	loff_t i_size = i_size_read(inode);
 
@@ -2726,7 +2725,6 @@ int block_write_full_page(struct page *page, get_block_t *get_block,
 	return __block_write_full_folio(inode, folio, get_block, wbc,
 			end_buffer_async_write);
 }
-EXPORT_SYMBOL(block_write_full_page);
 
 sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
 			    get_block_t *get_block)
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index dfdd7e5cf038..312bc6813357 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -444,7 +444,7 @@ int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *folio,
 	folio_clear_error(folio);
 
 	/*
-	 * Comments copied from block_write_full_page:
+	 * Comments copied from block_write_full_folio:
 	 *
 	 * The folio straddles i_size.  It must be zeroed out on each and every
 	 * writepage invocation because it may be mmapped.  "A file is mapped
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 5cffb079b87c..f986cd032b76 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -82,11 +82,11 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock,
 }
 
 /**
- * gfs2_write_jdata_folio - gfs2 jdata-specific version of block_write_full_page
+ * gfs2_write_jdata_folio - gfs2 jdata-specific version of block_write_full_folio
  * @folio: The folio to write
  * @wbc: The writeback control
  *
- * This is the same as calling block_write_full_page, but it also
+ * This is the same as calling block_write_full_folio, but it also
  * writes pages outside of i_size
  */
 static int gfs2_write_jdata_folio(struct folio *folio,
diff --git a/fs/mpage.c b/fs/mpage.c
index d4963f3d8051..738882e0766d 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -642,7 +642,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc,
 	/*
 	 * The caller has a ref on the inode, so *mapping is stable
 	 */
-	ret = block_write_full_page(&folio->page, mpd->get_block, wbc);
+	ret = block_write_full_folio(folio, wbc, mpd->get_block);
 	mapping_set_error(mapping, ret);
 out:
 	mpd->bio = bio;
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 1c747a3baa3e..2d01517a2d59 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -1304,7 +1304,7 @@ static int ntfs_write_mst_block(struct page *page,
  * page cleaned.  The VM has already locked the page and marked it clean.
  *
  * For non-resident attributes, ntfs_writepage() writes the @page by calling
- * the ntfs version of the generic block_write_full_page() function,
+ * the ntfs version of the generic block_write_full_folio() function,
  * ntfs_write_block(), which in turn if necessary creates and writes the
  * buffers associated with the page asynchronously.
  *
@@ -1314,7 +1314,7 @@ static int ntfs_write_mst_block(struct page *page,
  * vfs inode dirty code path for the inode the mft record belongs to or via the
  * vm page dirty code path for the page the mft record is in.
  *
- * Based on ntfs_read_folio() and fs/buffer.c::block_write_full_page().
+ * Based on ntfs_read_folio() and fs/buffer.c::block_write_full_folio().
  *
  * Return 0 on success and -errno on error.
  */
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 91b32b2377ac..ea9127ba3208 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6934,7 +6934,7 @@ static int ocfs2_grab_eof_pages(struct inode *inode, loff_t start, loff_t end,
  * nonzero data on subsequent file extends.
  *
  * We need to call this before i_size is updated on the inode because
- * otherwise block_write_full_page() will skip writeout of pages past
+ * otherwise block_write_full_folio() will skip writeout of pages past
  * i_size.
  */
 int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle,
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 94e2a1244442..8b6d15010703 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -818,7 +818,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
 	/*
 	 * fs-writeback will release the dirty pages without page lock
 	 * whose offset are over inode size, the release happens at
-	 * block_write_full_page().
+	 * block_write_full_folio().
 	 */
 	i_size_write(inode, abs_to);
 	inode->i_blocks = ocfs2_inode_sector_count(inode);
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 94f6161eb45e..396b2adf24bf 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -252,8 +252,8 @@ void __bh_read_batch(int nr, struct buffer_head *bhs[],
  * address_spaces.
  */
 void block_invalidate_folio(struct folio *folio, size_t offset, size_t length);
-int block_write_full_page(struct page *page, get_block_t *get_block,
-				struct writeback_control *wbc);
+int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
+		void *get_block);
 int __block_write_full_folio(struct inode *inode, struct folio *folio,
 			get_block_t *get_block, struct writeback_control *wbc,
 			bh_end_io_t *handler);
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (12 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio Matthew Wilcox (Oracle)
@ 2023-12-15 20:02 ` Matthew Wilcox (Oracle)
  2023-12-20  6:36   ` Christoph Hellwig
  2023-12-16 20:51 ` [PATCH 00/14] Clean up the writeback paths Jens Axboe
  14 siblings, 1 reply; 34+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-12-15 20:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox (Oracle), Christoph Hellwig, linux-fsdevel,
	linux-kernel, linux-block

All callers are passing end_buffer_async_write as this argument, so we
can hardcode references to it within __block_write_full_folio().
That lets us make end_buffer_async_write() static.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/buffer.c                 | 22 ++++++++++------------
 fs/gfs2/aops.c              |  2 +-
 include/linux/buffer_head.h |  4 +---
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 2e69f0ddca37..d5ce6b29c893 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -372,10 +372,10 @@ static void end_buffer_async_read_io(struct buffer_head *bh, int uptodate)
 }
 
 /*
- * Completion handler for block_write_full_folio() - pages which are unlocked
- * during I/O, and which have PageWriteback cleared upon I/O completion.
+ * Completion handler for block_write_full_folio() - folios which are unlocked
+ * during I/O, and which have the writeback flag cleared upon I/O completion.
  */
-void end_buffer_async_write(struct buffer_head *bh, int uptodate)
+static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
 {
 	unsigned long flags;
 	struct buffer_head *first;
@@ -415,7 +415,6 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
 	spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
 	return;
 }
-EXPORT_SYMBOL(end_buffer_async_write);
 
 /*
  * If a page's buffers are under async readin (end_buffer_async_read
@@ -1787,8 +1786,7 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
  * causes the writes to be flagged as synchronous writes.
  */
 int __block_write_full_folio(struct inode *inode, struct folio *folio,
-			get_block_t *get_block, struct writeback_control *wbc,
-			bh_end_io_t *handler)
+			get_block_t *get_block, struct writeback_control *wbc)
 {
 	int err;
 	sector_t block;
@@ -1867,7 +1865,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
 			continue;
 		}
 		if (test_clear_buffer_dirty(bh)) {
-			mark_buffer_async_write_endio(bh, handler);
+			mark_buffer_async_write_endio(bh,
+				end_buffer_async_write);
 		} else {
 			unlock_buffer(bh);
 		}
@@ -1920,7 +1919,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
 		if (buffer_mapped(bh) && buffer_dirty(bh) &&
 		    !buffer_delay(bh)) {
 			lock_buffer(bh);
-			mark_buffer_async_write_endio(bh, handler);
+			mark_buffer_async_write_endio(bh,
+				end_buffer_async_write);
 		} else {
 			/*
 			 * The buffer may have been set dirty during
@@ -2704,8 +2704,7 @@ int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
 
 	/* Is the folio fully inside i_size? */
 	if (folio_pos(folio) + folio_size(folio) <= i_size)
-		return __block_write_full_folio(inode, folio, get_block, wbc,
-					       end_buffer_async_write);
+		return __block_write_full_folio(inode, folio, get_block, wbc);
 
 	/* Is the folio fully outside i_size? (truncate in progress) */
 	if (folio_pos(folio) >= i_size) {
@@ -2722,8 +2721,7 @@ int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
 	 */
 	folio_zero_segment(folio, offset_in_folio(folio, i_size),
 			folio_size(folio));
-	return __block_write_full_folio(inode, folio, get_block, wbc,
-			end_buffer_async_write);
+	return __block_write_full_folio(inode, folio, get_block, wbc);
 }
 
 sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index f986cd032b76..9914d7f54f7d 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -108,7 +108,7 @@ static int gfs2_write_jdata_folio(struct folio *folio,
 				folio_size(folio));
 
 	return __block_write_full_folio(inode, folio, gfs2_get_block_noalloc,
-			wbc, end_buffer_async_write);
+			wbc);
 }
 
 /**
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 396b2adf24bf..d78454a4dd1f 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -205,7 +205,6 @@ struct buffer_head *create_empty_buffers(struct folio *folio,
 		unsigned long blocksize, unsigned long b_state);
 void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
 void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
-void end_buffer_async_write(struct buffer_head *bh, int uptodate);
 
 /* Things to do with buffers at mapping->private_list */
 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
@@ -255,8 +254,7 @@ void block_invalidate_folio(struct folio *folio, size_t offset, size_t length);
 int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
 		void *get_block);
 int __block_write_full_folio(struct inode *inode, struct folio *folio,
-			get_block_t *get_block, struct writeback_control *wbc,
-			bh_end_io_t *handler);
+		get_block_t *get_block, struct writeback_control *wbc);
 int block_read_full_folio(struct folio *, get_block_t *);
 bool block_is_partially_uptodate(struct folio *, size_t from, size_t count);
 int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/14] fs: Remove clean_page_buffers()
  2023-12-15 20:02 ` [PATCH 01/14] fs: Remove clean_page_buffers() Matthew Wilcox (Oracle)
@ 2023-12-16  4:27   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:27 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 02/14] fs: Convert clean_buffers() to take a folio
  2023-12-15 20:02 ` [PATCH 02/14] fs: Convert clean_buffers() to take a folio Matthew Wilcox (Oracle)
@ 2023-12-16  4:27   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:27 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:33PM +0000, Matthew Wilcox (Oracle) wrote:
> The only caller already has a folio, so pass it in and use it throughout.
> Saves two calls to compound_head().

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage
  2023-12-15 20:02 ` [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage Matthew Wilcox (Oracle)
@ 2023-12-16  4:29   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:29 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:34PM +0000, Matthew Wilcox (Oracle) wrote:
> Some architectures support a very large PAGE_SIZE, so instead of the 8
> pointers we see with a 4kB PAGE_SIZE, we can see 128 pointers with 64kB
> or so many on Hexagon that it trips compiler warnings about exceeding
> stack frame size.
> 
> All we're doing with this array is checking for block contiguity, which we
> can as well do by remembering the address of the first block in the page
> and checking this block is at the appropriate offset from that address.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage
  2023-12-15 20:02 ` [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage Matthew Wilcox (Oracle)
@ 2023-12-16  4:29   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:29 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:35PM +0000, Matthew Wilcox (Oracle) wrote:
> Some architectures support a very large PAGE_SIZE, so instead of the 8
> pointers we see with a 4kB PAGE_SIZE, we can see 128 pointers with 64kB
> or so many on Hexagon that it trips compiler warnings about exceeding
> stack frame size.
> 
> All we're doing with this array is checking for block contiguity, which we
> can as well do by remembering the address of the first block in the page
> and checking this block is at the appropriate offset from that address.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 05/14] adfs: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 05/14] adfs: Remove writepage implementation Matthew Wilcox (Oracle)
@ 2023-12-16  4:31   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:31 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:36PM +0000, Matthew Wilcox (Oracle) wrote:
> If the filesystem implements migrate_folio and writepages, there is
> no need for a writepage implementation.

Looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

(with the usual caveat for basically untestable otheros fses that'll
also apply to various later patches)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-15 20:02 ` [PATCH 08/14] hfsplus: Really remove hfsplus_writepage Matthew Wilcox (Oracle)
@ 2023-12-16  4:33   ` Christoph Hellwig
  2023-12-18 10:41     ` Johannes Thumshirn
  0 siblings, 1 reply; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:33 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:39PM +0000, Matthew Wilcox (Oracle) wrote:
> The earlier commit to remove hfsplus_writepage only removed it from
> one of the aops.  Remove it from the btree_aops as well.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

although I had some reason to be careful back then.  hfsplus should
be testable again that the hfsplus Linux port is back alive.  Is there
any volunteer to test hfsplus on the fsdevel list?


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 10/14] ocfs2: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 10/14] ocfs2: " Matthew Wilcox (Oracle)
@ 2023-12-16  4:34   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:34 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:41PM +0000, Matthew Wilcox (Oracle) wrote:
> If the filesystem implements migrate_folio and writepages, there is
> no need for a writepage implementation.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 12/14] ufs: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 12/14] ufs: " Matthew Wilcox (Oracle)
@ 2023-12-16  4:34   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:34 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio
  2023-12-15 20:02 ` [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio Matthew Wilcox (Oracle)
@ 2023-12-16  4:35   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-16  4:35 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:44PM +0000, Matthew Wilcox (Oracle) wrote:
> Convert the function to be compatible with writepage_t so that it
> can be passed to write_cache_pages() by blkdev.  This removes a call
> to compound_head().  We can also remove the function export as both
> callers are built-in.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 00/14] Clean up the writeback paths
  2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
                   ` (13 preceding siblings ...)
  2023-12-15 20:02 ` [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio Matthew Wilcox (Oracle)
@ 2023-12-16 20:51 ` Jens Axboe
  14 siblings, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2023-12-16 20:51 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), Andrew Morton
  Cc: Christoph Hellwig, linux-fsdevel, linux-kernel, linux-block

On 12/15/23 1:02 PM, Matthew Wilcox (Oracle) wrote:
> I don't think any of this conflicts with the writeback refactoring that
> Christoph has kindly taken over from me, although we might want to redo
> patch 13 on that infrastructure rather than using write_cache_pages().
> That can be a later addition.
> 
> Most of these patches verge on the trivial, converting filesystems that
> just use block_write_full_page() to use mpage_writepages().  But as we
> saw with Christoph's earlier patchset, there can be some "interesting"
> gotchas, and I clearly haven't tested the majority of filesystems I've
> touched here.
> 
> Patches 3 & 4 get rid of a lot of stack usage on architectures with
> larger page sizes; 1024 bytes on 64-bit systems with 64KiB pages.
> It starts to open the door to larger folio sizes on all architectures,
> but it's certainly not enough yet.
> 
> Patch 14 is kind of trivial, but it's nice to get that simplification in.

Series looks good to me:

Reviewed-by: Jens Axboe <axboe@kernel.dk>

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 06/14] bfs: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 06/14] bfs: " Matthew Wilcox (Oracle)
@ 2023-12-17 16:48   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-17 16:48 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 09/14] minix: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 09/14] minix: Remove writepage implementation Matthew Wilcox (Oracle)
@ 2023-12-17 16:48   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-17 16:48 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 11/14] sysv: Remove writepage implementation
  2023-12-15 20:02 ` [PATCH 11/14] sysv: " Matthew Wilcox (Oracle)
@ 2023-12-17 16:48   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-17 16:48 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 07/14] hfs: Really remove hfs_writepage
  2023-12-15 20:02 ` [PATCH 07/14] hfs: Really remove hfs_writepage Matthew Wilcox (Oracle)
@ 2023-12-18  4:31   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-18  4:31 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:38PM +0000, Matthew Wilcox (Oracle) wrote:
> The earlier commit to remove hfs_writepage only removed it from
> one of the aops.  Remove it from the btree_aops as well.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-16  4:33   ` Christoph Hellwig
@ 2023-12-18 10:41     ` Johannes Thumshirn
  2023-12-18 15:04       ` Christoph Hellwig
  0 siblings, 1 reply; 34+ messages in thread
From: Johannes Thumshirn @ 2023-12-18 10:41 UTC (permalink / raw)
  To: Christoph Hellwig, Matthew Wilcox (Oracle)
  Cc: Andrew Morton, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org

On 16.12.23 05:33, Christoph Hellwig wrote:
> On Fri, Dec 15, 2023 at 08:02:39PM +0000, Matthew Wilcox (Oracle) wrote:
>> The earlier commit to remove hfsplus_writepage only removed it from
>> one of the aops.  Remove it from the btree_aops as well.
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> although I had some reason to be careful back then.  hfsplus should
> be testable again that the hfsplus Linux port is back alive.  Is there
> any volunteer to test hfsplus on the fsdevel list?

What do you have in mind on that side? "Just" running it through fstests 
and see that we don't regress here or more than that?


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-18 10:41     ` Johannes Thumshirn
@ 2023-12-18 15:04       ` Christoph Hellwig
  2023-12-18 15:40         ` Johannes Thumshirn
  0 siblings, 1 reply; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-18 15:04 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Christoph Hellwig, Matthew Wilcox (Oracle), Andrew Morton,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org

On Mon, Dec 18, 2023 at 10:41:27AM +0000, Johannes Thumshirn wrote:
> > although I had some reason to be careful back then.  hfsplus should
> > be testable again that the hfsplus Linux port is back alive.  Is there
> > any volunteer to test hfsplus on the fsdevel list?
> 
> What do you have in mind on that side? "Just" running it through fstests 
> and see that we don't regress here or more than that?

Yeah.  Back in the day I ran hfsplus through xfstests, IIRC that might
even have been the initial motivation for supporting file systems
that don't support sparse files.  I bet a lot has regressed or isn't
support since, though.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-18 15:04       ` Christoph Hellwig
@ 2023-12-18 15:40         ` Johannes Thumshirn
  2024-01-04 17:25           ` Jan Kara
  0 siblings, 1 reply; 34+ messages in thread
From: Johannes Thumshirn @ 2023-12-18 15:40 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Matthew Wilcox (Oracle), Andrew Morton,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org

On 18.12.23 16:04, Christoph Hellwig wrote:
> On Mon, Dec 18, 2023 at 10:41:27AM +0000, Johannes Thumshirn wrote:
>>> although I had some reason to be careful back then.  hfsplus should
>>> be testable again that the hfsplus Linux port is back alive.  Is there
>>> any volunteer to test hfsplus on the fsdevel list?
>>
>> What do you have in mind on that side? "Just" running it through fstests
>> and see that we don't regress here or more than that?
> 
> Yeah.  Back in the day I ran hfsplus through xfstests, IIRC that might
> even have been the initial motivation for supporting file systems
> that don't support sparse files.  I bet a lot has regressed or isn't
> support since, though.
> 

Let me see what I can do on that front over my winter vacation. As long 
as there's no APFS support in Linux its the only way to exchange data 
between macOS and Linux anyways, so we shouldn't break it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio
  2023-12-15 20:02 ` [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio Matthew Wilcox (Oracle)
@ 2023-12-20  6:36   ` Christoph Hellwig
  0 siblings, 0 replies; 34+ messages in thread
From: Christoph Hellwig @ 2023-12-20  6:36 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Christoph Hellwig, linux-fsdevel, linux-kernel,
	linux-block

On Fri, Dec 15, 2023 at 08:02:45PM +0000, Matthew Wilcox (Oracle) wrote:
> All callers are passing end_buffer_async_write as this argument, so we
> can hardcode references to it within __block_write_full_folio().
> That lets us make end_buffer_async_write() static.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/14] hfsplus: Really remove hfsplus_writepage
  2023-12-18 15:40         ` Johannes Thumshirn
@ 2024-01-04 17:25           ` Jan Kara
  0 siblings, 0 replies; 34+ messages in thread
From: Jan Kara @ 2024-01-04 17:25 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Christoph Hellwig, Matthew Wilcox (Oracle), Andrew Morton,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org

On Mon 18-12-23 15:40:42, Johannes Thumshirn wrote:
> On 18.12.23 16:04, Christoph Hellwig wrote:
> > On Mon, Dec 18, 2023 at 10:41:27AM +0000, Johannes Thumshirn wrote:
> >>> although I had some reason to be careful back then.  hfsplus should
> >>> be testable again that the hfsplus Linux port is back alive.  Is there
> >>> any volunteer to test hfsplus on the fsdevel list?
> >>
> >> What do you have in mind on that side? "Just" running it through fstests
> >> and see that we don't regress here or more than that?
> > 
> > Yeah.  Back in the day I ran hfsplus through xfstests, IIRC that might
> > even have been the initial motivation for supporting file systems
> > that don't support sparse files.  I bet a lot has regressed or isn't
> > support since, though.
> > 
> 
> Let me see what I can do on that front over my winter vacation. As long 
> as there's no APFS support in Linux its the only way to exchange data 
> between macOS and Linux anyways, so we shouldn't break it.

AFAIK macOS actually does support UDF so there are other filesystems you
can use for data exchange.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2024-01-04 17:25 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15 20:02 [PATCH 00/14] Clean up the writeback paths Matthew Wilcox (Oracle)
2023-12-15 20:02 ` [PATCH 01/14] fs: Remove clean_page_buffers() Matthew Wilcox (Oracle)
2023-12-16  4:27   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 02/14] fs: Convert clean_buffers() to take a folio Matthew Wilcox (Oracle)
2023-12-16  4:27   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 03/14] fs: Reduce stack usage in __mpage_writepage Matthew Wilcox (Oracle)
2023-12-16  4:29   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 04/14] fs: Reduce stack usage in do_mpage_readpage Matthew Wilcox (Oracle)
2023-12-16  4:29   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 05/14] adfs: Remove writepage implementation Matthew Wilcox (Oracle)
2023-12-16  4:31   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 06/14] bfs: " Matthew Wilcox (Oracle)
2023-12-17 16:48   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 07/14] hfs: Really remove hfs_writepage Matthew Wilcox (Oracle)
2023-12-18  4:31   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 08/14] hfsplus: Really remove hfsplus_writepage Matthew Wilcox (Oracle)
2023-12-16  4:33   ` Christoph Hellwig
2023-12-18 10:41     ` Johannes Thumshirn
2023-12-18 15:04       ` Christoph Hellwig
2023-12-18 15:40         ` Johannes Thumshirn
2024-01-04 17:25           ` Jan Kara
2023-12-15 20:02 ` [PATCH 09/14] minix: Remove writepage implementation Matthew Wilcox (Oracle)
2023-12-17 16:48   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 10/14] ocfs2: " Matthew Wilcox (Oracle)
2023-12-16  4:34   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 11/14] sysv: " Matthew Wilcox (Oracle)
2023-12-17 16:48   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 12/14] ufs: " Matthew Wilcox (Oracle)
2023-12-16  4:34   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 13/14] fs: Convert block_write_full_page to block_write_full_folio Matthew Wilcox (Oracle)
2023-12-16  4:35   ` Christoph Hellwig
2023-12-15 20:02 ` [PATCH 14/14] fs: Remove the bh_end_io argument from __block_write_full_folio Matthew Wilcox (Oracle)
2023-12-20  6:36   ` Christoph Hellwig
2023-12-16 20:51 ` [PATCH 00/14] Clean up the writeback paths Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).