在 2024/11/12 15:35, Christoph Hellwig 写道:
On Mon, Nov 11, 2024 at 06:06:57PM +1030, Qu Wenruo wrote:
Why? They aren't exactly efficient, and it's just going to create
more Churn for Goldwyn's iomap work.
So it is not recommended to go the write_begin() and write_end() callbacks
at all?
Or just not recommended for btrfs?
They aren't a very efficient model, so I would not recommend to add
new users.
No wonder no one is adding support for IOCB_NOWAIT.
I know there are limits like those call backs do not support IOCB_NOWAIT,
and the memory allocation inefficient problem (it should only affect ocfs2),
but shouldn't we encourage to use the more common paths where all other fses
go?
I'd recommend to use iomap.
Definitely the way we will go in the long run.
Although I'm still struggling on the out-of-band dirty folio (someone
marked a folio dirty without notifying the fs) handling.
The iomap writepages implementation will just mark all the folio range
dirty and start mapping.
So I guess there must be some fs specific handling inside the mapping
function, let me dig it deeper and check Goldwyn's work for details.
Anyway thanks a lot pointing out that the write_begin() model is already
kinda deprecated.
Thanks,
Qu