Re: [PATCH v15 12/17] iomap: Convert iomap_page_mkwrite to use a folio

Christoph Hellwig
2021-07-20T07:13:55Z

On Mon, Jul 19, 2021 at 07:39:56PM +0100, Matthew Wilcox (Oracle) wrote:
> - struct page *page = data;
> + struct folio *folio = data;
> int ret;
>
> if (iomap->flags & IOMAP_F_BUFFER_HEAD) {
> - ret = __block_write_begin_int(page, pos, length, NULL, iomap);
> + ret = __block_write_begin_int(&folio->page, pos, length, NULL,
> + iomap);
> if (ret)
> return ret;
> - block_commit_write(page, 0, length);
> + block_commit_write(&folio->page, 0, length);
> } else {
> - WARN_ON_ONCE(!PageUptodate(page));
> - set_page_dirty(page);
> + WARN_ON_ONCE(!folio_test_uptodate(folio));
> + folio_mark_dirty(folio);

Not that having this else clause code for the !IOMAP_F_BUFFER_HEAD case
here is a bit silly, and becomes more so with folios - it should probably
move into the caller. I'll see what I can do there in this merge window
to prepare.

Otherwise this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>