[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YRYXAii0zZ0SzDt+@infradead.org>
Date: Fri, 13 Aug 2021 07:53:54 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: David Howells <dhowells@...hat.com>,
Jeff Layton <jlayton@...nel.org>,
Marc Dionne <marc.dionne@...istor.com>,
Ilya Dryomov <idryomov@...il.com>,
linux-afs@...ts.infradead.org, ceph-devel@...r.kernel.org,
linux-cachefs@...hat.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org
Subject: Re: [RFC][PATCH] netfs, afs, ceph: Use folios
On Thu, Aug 12, 2021 at 05:07:10PM +0100, Matthew Wilcox wrote:
> On Wed, Aug 11, 2021 at 02:07:51PM +0100, David Howells wrote:
> > (*) Can page_endio() be split into two separate functions, one for read
> > and one for write? If seems a waste of time to conditionally switch
> > between two different branches.
>
> At this point I'm thinking ...
>
> static inline void folio_end_read(struct folio *folio, int err)
> {
> if (!err)
> folio_set_uptodate(folio);
> folio_unlock(folio);
> }
>
> Clearly the page isn't uptodate at this point, or ->readpage wouldn't've
> been called. So there's no need to clear it. And PageError is
> completely useless.
Just opencoding the above makes a lot more sense. No need to turn err
into some acceptable form, and trivial to follow. Not all little
convenience helpers are good.
> > }
> >
> > - *_page = page;
> > + *_page = &folio->page;
>
> Can't do anything about this one; the write_begin API needs to be fixed.
It actually needs to go away. There's not real good use for that level
of API. netfs should just open code the releavant parts of
generic_perform_write, similar to iomap.
Powered by blists - more mailing lists