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@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx> > > --- > > 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