linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: brauner@kernel.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] iomap: convert iomap_writepages to writeack_iter
Date: Fri, 12 Apr 2024 08:34:55 -0700	[thread overview]
Message-ID: <20240412153455.GA11948@frogsfrogsfrogs> (raw)
In-Reply-To: <20240412061614.1511629-1-hch@lst.de>

[adding willy to cc just in case he sees something I didn't]

On Fri, Apr 12, 2024 at 08:16:14AM +0200, Christoph Hellwig wrote:
> This removes one indirect function call per folio, and adds type safety
> by not casting through a void pointer.
> 
> Based on a patch by Matthew Wilcox.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks like a straightforward conversion to me...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/iomap/buffered-io.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 4e8e41c8b3c0e4..e09441f4fceb6f 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -1958,18 +1958,13 @@ static int iomap_writepage_map(struct iomap_writepage_ctx *wpc,
>  	return error;
>  }
>  
> -static int iomap_do_writepage(struct folio *folio,
> -		struct writeback_control *wbc, void *data)
> -{
> -	return iomap_writepage_map(data, wbc, folio);
> -}
> -
>  int
>  iomap_writepages(struct address_space *mapping, struct writeback_control *wbc,
>  		struct iomap_writepage_ctx *wpc,
>  		const struct iomap_writeback_ops *ops)
>  {
> -	int			ret;
> +	struct folio *folio = NULL;
> +	int error;
>  
>  	/*
>  	 * Writeback from reclaim context should never happen except in the case
> @@ -1980,8 +1975,9 @@ iomap_writepages(struct address_space *mapping, struct writeback_control *wbc,
>  		return -EIO;
>  
>  	wpc->ops = ops;
> -	ret = write_cache_pages(mapping, wbc, iomap_do_writepage, wpc);
> -	return iomap_submit_ioend(wpc, ret);
> +	while ((folio = writeback_iter(mapping, wbc, folio, &error)))
> +		error = iomap_writepage_map(wpc, wbc, folio);
> +	return iomap_submit_ioend(wpc, error);
>  }
>  EXPORT_SYMBOL_GPL(iomap_writepages);
>  
> -- 
> 2.39.2
> 
> 

  reply	other threads:[~2024-04-12 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12  6:16 [PATCH] iomap: convert iomap_writepages to writeack_iter Christoph Hellwig
2024-04-12 15:34 ` Darrick J. Wong [this message]
2024-04-12 19:11 ` Mike Snitzer
2024-04-15 12:26 ` [PATCH] " Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240412153455.GA11948@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).