Re: [PATCH 4/6] fs: introduce RWF_DIRECT to allow using O_DIRECT on a per-IO basis

Christoph Hellwig
2025-06-12T07:15:36Z

On Wed, Jun 11, 2025 at 10:17:56AM -0400, Chuck Lever wrote:
> On 6/11/25 2:58 AM, Christoph Hellwig wrote:
> > On Tue, Jun 10, 2025 at 04:57:35PM -0400, Mike Snitzer wrote:
> >> Avoids the need to open code do_iter_readv_writev() purely to request
> >> that a sync iocb make use of IOCB_DIRECT.
> >>
> >> Care was taken to preserve the long-established value for IOCB_DIRECT
> >> (1 << 17) when introducing RWF_DIRECT.
> >
> > What is the problem with using vfs_iocb_iter_read instead of
> > vfs_iter_read and passing the iocb directly?
>
> Christoph, are you suggesting that nfsd_iter_read() should always
> call vfs_iocb_iter_read() instead of vfs_iter_read()? That might be
> a nice clean up in general.

Yes. I don't think it's such a big cleanup because the helper is a
bit lower level. But IFF we are going down the route of using
direct I/O this will also allow to do asynchronous I/O instead of
blocking the server threads as well.