Re: [PATCH RFC v2 2/2] block: enable RWF_DONTCACHE for block devices
From: Tal Zussman
Date: Thu Feb 26 2026 - 19:45:09 EST
On Thu, Feb 26, 2026 at 5:07 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> > --- 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.
Will do.
>
> Note that you also need to cover the !CONFIG_BUFFER_HEAD case.
>
I don't think there is a !CONFIG_BUFFER_HEAD case. The only user of
block_write_begin_iocb() would be blkdev_write_begin(), which is only
defined under CONFIG_BUFFER_HEAD. !CONFIG_BUFFER_HEAD paths use iomap which
doesn't use it. And buffer.c is only compiled for CONFIG_BUFFER_HEAD. Unless
I'm missing something?
Thanks,
Tal