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

From: Christoph Hellwig

Date: Thu Feb 26 2026 - 17:07:51 EST


> --- 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.