Re: [PATCH RFC v2 2/2] block: enable RWF_DONTCACHE for block devices

Christoph Hellwig
2026-02-26T22:07:19Z

> --- a/fs/bfs/file.c
> +++ b/fs/bfs/file.c
> @@ -177,7 +177,7 @@ static int bfs_write_begin(const struct kiocb *iocb,
> {
> int ret;
>
> - ret = block_write_begin(mapping, pos, len, foliop, bfs_get_block);
> + ret = block_write_begin(iocb, mapping, pos, len, foliop, bfs_get_block);

Please don't change the prototoype for block_write_begin and thus
cause churn for all these legacy file systems. Add a new
block_write_begin_iocb, and use that in the block code and to implement
block_write_begin.

And avoid the overly long line there to keep the code readable.

Note that you also need to cover the !CONFIG_BUFFER_HEAD case.