Re: [PATCH v3 0/4] btrfs: basic refactor of btrfs_buffered_write()

Goldwyn Rodrigues
2020-08-25T13:32:56Z

On 12:44 25/08, Christoph Hellwig wrote:
> Does much refactoring of this code make sense? Goldwyn has initial
> patches to convert the buffered I/O path to iomap, and I hope that would
> pick up speed now that the direct I/O conversion landed.
>

Yes. Btrfs needs to handle pages on it's own and needs to lock them
because of extent locking. Page locks need to be performed before extent
locking. If we proceed with converting to iomap, we may have to change
iomap->page_ops->page_prepare to (say) iomap->page_ops->get_page, which
would return the locked page. Not sure if it still makes sense to
convert to iomap for "just" copy_from/to_user().. I will need to perform
tests for that.

Btrfs does want sub-page I/O feature iomap offers. For
that, I still need to figure out a way to for releasepage callback
without using page->private since iomap uses it for iomap_page_private.

--
Goldwyn