> + if (page_ops && page_ops->page_prepare)
> + folio = page_ops->page_prepare(iter, pos, len);
> + else
> + folio = iomap_get_folio(iter, pos);
> + if (IS_ERR(folio))
> return PTR_ERR(folio);
I'd love to have a iomap_get_folio helper for this
Looks good:
Reviewed-by: Christoph Hellwig
although it might make sense to just do the rename in patch 5 which
changes the signature to return a folio?
Looks good:
Reviewed-by: Christoph Hellwig
On Sun, Jan 8, 2023 at 6:32 PM Christoph Hellwig wrote:
> On Wed, Jan 04, 2023 at 07:08:17PM +, Matthew Wilcox wrote:
> > On Wed, Jan 04, 2023 at 09:53:17AM -0800, Darrick J. Wong wrote:
> > > I wonder if this should be reworked a bit to reduce indenting:
> > >
> > > if (PTR_ERR(folio) ==
On Sat, Dec 31, 2022 at 04:09:19PM +0100, Andreas Gruenbacher wrote:
> Variable xfs_iomap_folio_ops isn't used outside xfs_iomap.c, so it
> should be static.
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
On Wed, Jan 04, 2023 at 07:08:17PM +, Matthew Wilcox wrote:
> On Wed, Jan 04, 2023 at 09:53:17AM -0800, Darrick J. Wong wrote:
> > I wonder if this should be reworked a bit to reduce indenting:
> >
> > if (PTR_ERR(folio) == -ESTALE) {
>
> FYI this is a bad habit to be in. The compiler
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
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.
Change the iomap ->page_prepare() handler to get and return a locked
folio instead of doing that in iomap_write_begin(). This allows to
recover from out-of-memory situations in ->page_prepare(), which
eliminates the corresponding error handling code in iomap_write_begin().
The ->put_folio()
The ->page_prepare() handler in struct iomap_page_ops is now somewhat
misnamed, so rename it to ->get_folio().
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Darrick J. Wong
Reviewed-by: Christoph Hellwig
---
fs/gfs2/bmap.c | 6 +++---
fs/iomap/buffered-io.c | 4 ++--
The operations in struct page_ops all operate on folios, so rename
struct page_ops to struct folio_ops.
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Darrick J. Wong
Reviewed-by: Christoph Hellwig
---
fs/gfs2/bmap.c | 4 ++--
fs/iomap/buffered-io.c | 12 ++--
Eliminate the ->iomap_valid() handler by switching to a ->get_folio()
handler and validating the mapping there.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 26 +-
fs/xfs/xfs_iomap.c | 37 ++---
include/linux/iomap.h
When an iomap defines a ->page_done() handler in its page_ops, delegate
unlocking the folio and putting the folio reference to that handler.
This allows to fix a race between journaled data writes and folio
writeback in gfs2: before this change, gfs2_iomap_page_done() was called
after unlocking
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
The ->page_done() handler in struct iomap_page_ops is now somewhat
misnamed in that it mainly deals with unlocking and putting a folio, so
rename it to ->put_folio().
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Darrick J. Wong
Reviewed-by: Christoph Hellwig
---
fs/gfs2/bmap.c | 4
Here's an updated version of this patch queue. Changes since v5 [*]:
* A new iomap-internal __iomap_get_folio() helper was added.
* The previous iomap-internal iomap_put_folio() helper was renamed to
__iomap_put_folio() to mirror __iomap_get_folio().
* The comment describing struct
On Sun, Jan 8, 2023 at 6:29 PM Christoph Hellwig wrote:
> > + if (page_ops && page_ops->page_prepare)
> > + folio = page_ops->page_prepare(iter, pos, len);
> > + else
> > + folio = iomap_get_folio(iter, pos);
> > + if (IS_ERR(folio))
> > return
Add an __iomap_put_folio() helper to encapsulate unlocking the folio,
calling ->page_done(), and putting the folio. Use the new helper in
iomap_write_begin() and iomap_write_end().
This effectively doesn't change the way the code works, but prepares for
successive improvements.
Signed-off-by:
Add an __iomap_get_folio() helper as the counterpart of the existing
__iomap_put_folio() helper. Use the new helper in iomap_write_begin().
Not a functional change.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 16
1 file changed, 12 insertions(+), 4
Variable xfs_iomap_folio_ops isn't used outside xfs_iomap.c, so it
should be static.
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Christoph Hellwig
---
fs/xfs/xfs_iomap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index
On Sun, Jan 08, 2023 at 08:40:32PM +0100, Andreas Gruenbacher wrote:
> Eliminate the ->iomap_valid() handler by switching to a ->get_folio()
> handler and validating the mapping there.
>
> Signed-off-by: Andreas Gruenbacher
I think this is wrong.
The ->iomap_valid() function handles a
Looks good:
Reviewed-by: Christoph Hellwig
24 matches
Mail list logo