Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-16 Thread Christoph Hellwig
On Mon, Jan 16, 2023 at 01:18:07PM +, Matthew Wilcox wrote: > Essentially reverting 44835d20b2a0. Yep. > Although we retain the merging of > the lock & get functions via the use of FGP flags. Let me think about > it for a day. Yes. But looking at the code again I wonder if even that is

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-16 Thread Matthew Wilcox
On Sun, Jan 15, 2023 at 11:34:26PM -0800, Christoph Hellwig wrote: > We could do that. But while reading what Darrick wrote I came up with > another idea I quite like. Just split the FGP_ENTRY handling into > a separate helper. The logic and use cases are quite different from > the normal page

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-16 Thread Christoph Hellwig
On Mon, Jan 16, 2023 at 05:46:01AM +, Matthew Wilcox wrote: > > OFC now I wonder, can we simply say that the return value is "The found > > folio or NULL if you set FGP_ENTRY; or the found folio or a negative > > errno if you don't" ? > > Erm ... I would rather not! Agreed. > > Part of me

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-15 Thread Matthew Wilcox
On Sun, Jan 15, 2023 at 09:06:50AM -0800, Darrick J. Wong wrote: > On Sun, Jan 15, 2023 at 09:01:22AM -0800, Darrick J. Wong wrote: > > On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > > On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: > > > > On Mon, Jan 09,

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-15 Thread Darrick J. Wong
On Sun, Jan 15, 2023 at 09:01:22AM -0800, Darrick J. Wong wrote: > On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: > > > On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > > > > We can handle

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-15 Thread Darrick J. Wong
On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: > > On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > > > We can handle that by adding a new IOMAP_NOCREATE iterator flag and > > > checking for

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-12 Thread Christoph Hellwig
On Thu, Jan 12, 2023 at 07:52:41AM +1100, Dave Chinner wrote: > Exposing internal implementation details in the API > that is supposed to abstract away the internal implementation > details from users doesn't seem like a great idea to me. While I somewhat agree with the concern of leaking the

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-11 Thread Dave Chinner
On Wed, Jan 11, 2023 at 07:36:26PM +, Matthew Wilcox wrote: > On Tue, Jan 10, 2023 at 07:24:27AM -0800, Christoph Hellwig wrote: > > On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > > > Exactly. And as I already pointed out in reply to Dave's original > > > > patch what we

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-11 Thread Matthew Wilcox
On Tue, Jan 10, 2023 at 07:24:27AM -0800, Christoph Hellwig wrote: > On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > > Exactly. And as I already pointed out in reply to Dave's original > > > patch what we really should be doing is returning an ERR_PTR from > > >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-10 Thread Christoph Hellwig
On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > Exactly. And as I already pointed out in reply to Dave's original > > patch what we really should be doing is returning an ERR_PTR from > > __filemap_get_folio instead of reverse-engineering the expected > > error code. > >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-10 Thread Matthew Wilcox
On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: > On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > > We can handle that by adding a new IOMAP_NOCREATE iterator flag and > > checking for that in iomap_get_folio(). Your patch then turns into > > the below. >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-10 Thread Christoph Hellwig
On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > We can handle that by adding a new IOMAP_NOCREATE iterator flag and > checking for that in iomap_get_folio(). Your patch then turns into > the below. Exactly. And as I already pointed out in reply to Dave's original patch

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-10 Thread Andreas Grünbacher
Am Di., 10. Jan. 2023 um 09:52 Uhr schrieb Christoph Hellwig : > On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > > We can handle that by adding a new IOMAP_NOCREATE iterator flag and > > checking for that in iomap_get_folio(). Your patch then turns into > > the below. > >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-09 Thread Andreas Gruenbacher
On Sun, Jan 8, 2023 at 10:33 PM Dave Chinner wrote: > On Sun, Jan 08, 2023 at 08:40:28PM +0100, Andreas Gruenbacher wrote: > > Add an iomap_get_folio() helper that gets a folio reference based on > > an iomap iterator and an offset into the address space. Use it in > > iomap_write_begin(). > > >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-08 Thread Dave Chinner
On Sun, Jan 08, 2023 at 08:40:28PM +0100, Andreas Gruenbacher wrote: > Add an iomap_get_folio() helper that gets a folio reference based on > an iomap iterator and an offset into the address space. Use it in > iomap_write_begin(). > > Signed-off-by: Andreas Gruenbacher > Reviewed-by: Darrick J.

[Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-08 Thread Andreas Gruenbacher
Add an iomap_get_folio() helper that gets a folio reference based on an iomap iterator and an offset into the address space. Use it in iomap_write_begin(). Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 39