From: Josef Bacik <josef@toxicpanda.com>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, amir73il@gmail.com,
miklos@szeredi.hu, kernel-team@fb.com
Subject: Re: [PATCH v4 06/10] fuse: convert fuse_do_readpage to use folios
Date: Tue, 1 Oct 2024 16:19:39 -0400 [thread overview]
Message-ID: <20241001201939.GA952979@perftesting> (raw)
In-Reply-To: <CAJnrk1bmyxJqsYwSWBdRX8P29cLi_R+6cb0ZDnzHEMj4vG-FyA@mail.gmail.com>
On Tue, Oct 01, 2024 at 09:54:51AM -0700, Joanne Koong wrote:
> On Mon, Sep 30, 2024 at 6:46 AM Josef Bacik <josef@toxicpanda.com> wrote:
> >
> > Now that the buffered write path is using folios, convert
> > fuse_do_readpage() to take a folio instead of a page, update it to use
> > the appropriate folio helpers, and update the callers to pass in the
> > folio directly instead of a page.
> >
> > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
>
> Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
>
> > ---
> > fs/fuse/file.c | 26 +++++++++++++-------------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> > index 2af9ec67a8e7..45667c40de7a 100644
> > --- a/fs/fuse/file.c
> > +++ b/fs/fuse/file.c
> > @@ -858,12 +858,13 @@ static void fuse_short_read(struct inode *inode, u64 attr_ver, size_t num_read,
> > }
> > }
> >
> > -static int fuse_do_readpage(struct file *file, struct page *page)
> > +static int fuse_do_readfolio(struct file *file, struct folio *folio)
> > {
> > - struct inode *inode = page->mapping->host;
> > + struct inode *inode = folio->mapping->host;
> > struct fuse_mount *fm = get_fuse_mount(inode);
> > - loff_t pos = page_offset(page);
> > + loff_t pos = folio_pos(folio);
> > struct fuse_page_desc desc = { .length = PAGE_SIZE };
> > + struct page *page = &folio->page;
> > struct fuse_io_args ia = {
> > .ap.args.page_zeroing = true,
> > .ap.args.out_pages = true,
> > @@ -875,11 +876,11 @@ static int fuse_do_readpage(struct file *file, struct page *page)
> > u64 attr_ver;
> >
> > /*
> > - * Page writeback can extend beyond the lifetime of the
> > - * page-cache page, so make sure we read a properly synced
> > - * page.
> > + * With the temporary pages that are used to complete writeback, we can
> > + * have writeback that extends beyond the lifetime of the folio. So
> > + * make sure we read a properly synced folio.
> > */
> > - fuse_wait_on_page_writeback(inode, page->index);
> > + fuse_wait_on_folio_writeback(inode, folio);
> >
> > attr_ver = fuse_get_attr_version(fm->fc);
> >
> > @@ -897,25 +898,24 @@ static int fuse_do_readpage(struct file *file, struct page *page)
> > if (res < desc.length)
> > fuse_short_read(inode, attr_ver, res, &ia.ap);
> >
> > - SetPageUptodate(page);
> > + folio_mark_uptodate(folio);
> >
> > return 0;
> > }
> >
> > static int fuse_read_folio(struct file *file, struct folio *folio)
> > {
> > - struct page *page = &folio->page;
> > - struct inode *inode = page->mapping->host;
> > + struct inode *inode = folio->mapping->host;
> > int err;
> >
> > err = -EIO;
> > if (fuse_is_bad(inode))
> > goto out;
> >
> > - err = fuse_do_readpage(file, page);
> > + err = fuse_do_readfolio(file, folio);
> > fuse_invalidate_atime(inode);
> > out:
> > - unlock_page(page);
> > + folio_unlock(folio);
> > return err;
> > }
> >
> > @@ -2444,7 +2444,7 @@ static int fuse_write_begin(struct file *file, struct address_space *mapping,
> > folio_zero_segment(folio, 0, off);
> > goto success;
> > }
> > - err = fuse_do_readpage(file, &folio->page);
> > + err = fuse_do_readfolio(file, folio);
>
> I'm on top of Miklos' for-next tree but I'm seeing this patch unable
> to apply cleanly. On the top of the tree, I see the original line as:
>
> err = fuse_do_readpage(file, page);
>
> Is there another patch/patchset this stack is based on top of?
Yeah Willy had a folio conversion that's in Linus's tree but is newer than
Miklos's base for his tree. Thanks,
Josef
next prev parent reply other threads:[~2024-10-01 20:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 13:45 [PATCH v4 00/10] fuse: folio conversions Josef Bacik
2024-09-30 13:45 ` [PATCH v4 01/10] fuse: convert readahead to use folios Josef Bacik
2024-09-30 13:45 ` [PATCH v4 02/10] fuse: convert fuse_send_write_pages " Josef Bacik
2024-09-30 13:45 ` [PATCH v4 03/10] fuse: convert fuse_fill_write_pages " Josef Bacik
2024-09-30 13:45 ` [PATCH v4 04/10] fuse: convert fuse_page_mkwrite " Josef Bacik
2024-09-30 13:45 ` [PATCH v4 05/10] fuse: use kiocb_modified in buffered write path Josef Bacik
2024-09-30 13:45 ` [PATCH v4 06/10] fuse: convert fuse_do_readpage to use folios Josef Bacik
2024-10-01 16:54 ` Joanne Koong
2024-10-01 20:19 ` Josef Bacik [this message]
2024-09-30 13:45 ` [PATCH v4 07/10] fuse: convert fuse_writepage_need_send to take a folio Josef Bacik
2024-09-30 13:45 ` [PATCH v4 08/10] fuse: use the folio based vmstat helpers Josef Bacik
2024-09-30 13:45 ` [PATCH v4 09/10] fuse: convert fuse_retrieve to use folios Josef Bacik
2024-09-30 13:45 ` [PATCH v4 10/10] fuse: convert fuse_notify_store " Josef Bacik
2024-10-18 9:59 ` [PATCH v4 00/10] fuse: folio conversions Miklos Szeredi
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=20241001201939.GA952979@perftesting \
--to=josef@toxicpanda.com \
--cc=amir73il@gmail.com \
--cc=joannelkoong@gmail.com \
--cc=kernel-team@fb.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).