linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, amir73il@gmail.com,
	miklos@szeredi.hu, bschubert@ddn.com
Subject: Re: [PATCH 03/11] fuse: convert fuse_fill_write_pages to use folios
Date: Tue, 27 Aug 2024 18:25:33 -0400	[thread overview]
Message-ID: <20240827222533.GD2597336@perftesting> (raw)
In-Reply-To: <CAJnrk1ZKo70gkgQn0uLuy6QFYPJwhujxcZBS+GFj_X2_-kpS0g@mail.gmail.com>

On Tue, Aug 27, 2024 at 02:30:49PM -0700, Joanne Koong wrote:
> On Tue, Aug 27, 2024 at 1:46 PM Josef Bacik <josef@toxicpanda.com> wrote:
> >
> > Convert this to grab the folio directly, and update all the helpers to
> > use the folio related functions.
> >
> > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> > ---
> >  fs/fuse/file.c | 28 +++++++++++++++-------------
> >  1 file changed, 15 insertions(+), 13 deletions(-)
> >
> > diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> > index 3621dbc17167..8cd3911446b6 100644
> > --- a/fs/fuse/file.c
> > +++ b/fs/fuse/file.c
> > @@ -1215,7 +1215,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_io_args *ia,
> >
> >         do {
> >                 size_t tmp;
> > -               struct page *page;
> > +               struct folio *folio;
> >                 pgoff_t index = pos >> PAGE_SHIFT;
> >                 size_t bytes = min_t(size_t, PAGE_SIZE - offset,
> >                                      iov_iter_count(ii));
> > @@ -1227,25 +1227,27 @@ static ssize_t fuse_fill_write_pages(struct fuse_io_args *ia,
> >                 if (fault_in_iov_iter_readable(ii, bytes))
> >                         break;
> >
> > -               err = -ENOMEM;
> > -               page = grab_cache_page_write_begin(mapping, index);
> > -               if (!page)
> > +               folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
> > +                                           mapping_gfp_mask(mapping));
> > +               if (!IS_ERR(folio)) {
> 
> I think you meant to put IS_ERR here instead of !IS_ERR?

I definitely did, so now I have to go look at my fstests setup and figure out
why this didn't fall over.  Nice catch, thanks,

Josef

  reply	other threads:[~2024-08-27 22:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 20:45 [PATCH 00/11] fuse: convert to using folios and iomap Josef Bacik
2024-08-27 20:45 ` [PATCH 01/11] fuse: convert readahead to use folios Josef Bacik
2024-08-27 21:46   ` Matthew Wilcox
2024-08-27 22:23     ` Josef Bacik
2024-08-27 20:45 ` [PATCH 02/11] fuse: convert fuse_send_write_pages " Josef Bacik
2024-08-27 21:53   ` Matthew Wilcox
2024-08-27 22:24     ` Josef Bacik
2024-08-27 20:45 ` [PATCH 03/11] fuse: convert fuse_fill_write_pages " Josef Bacik
2024-08-27 21:30   ` Joanne Koong
2024-08-27 22:25     ` Josef Bacik [this message]
2024-08-27 20:45 ` [PATCH 04/11] fuse: convert fuse_page_mkwrite " Josef Bacik
2024-08-27 20:45 ` [PATCH 05/11] fuse: use kiocb_modified in buffered write path Josef Bacik
2024-08-27 20:45 ` [PATCH 06/11] fuse: use iomap for writeback cache buffered writes Josef Bacik
2024-08-28  5:16   ` Christoph Hellwig
2024-08-27 20:45 ` [PATCH 07/11] fuse: convert fuse_do_readpage to use folios Josef Bacik
2024-08-27 20:45 ` [PATCH 08/11] fuse: convert fuse_writepage_need_send to take a folio Josef Bacik
2024-08-27 20:45 ` [PATCH 09/11] fuse: use the folio based vmstat helpers Josef Bacik
2024-08-27 22:05   ` Joanne Koong
2024-08-27 20:45 ` [PATCH 10/11] fuse: convert fuse_retrieve to use folios Josef Bacik
2024-08-27 22:10   ` Joanne Koong
2024-08-27 20:45 ` [PATCH 11/11] fuse: convert fuse_notify_store " Josef Bacik
2024-08-27 21:36 ` [PATCH 00/11] fuse: convert to using folios and iomap Bernd Schubert
2024-08-27 22:18   ` Josef Bacik

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=20240827222533.GD2597336@perftesting \
    --to=josef@toxicpanda.com \
    --cc=amir73il@gmail.com \
    --cc=bschubert@ddn.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).