lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/23] VFS: Add FMODE_CAN_ODIRECT file flag
On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote:
> Currently various places test if direct IO is possible on a file by
> checking for the existence of the direct_IO address space operation.
> This is a poor choice, as the direct_IO operation may not be used - it is
> only used if the generic_file_*_iter functions are called for direct IO
> and some filesystems - particularly NFS - don't do this.
>
> Instead, introduce a new f_mode flag: FMODE_CAN_ODIRECT and change the
> various places to check this (avoiding pointer dereferences).
> do_dentry_open() will set this flag if ->direct_IO is present, so
> filesystems do not need to be changed.
>
> NFS *is* changed, to set the flag explicitly and discard the direct_IO
> entry in the address_space_operations for files.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

It would be nice to throw in a cleanup to remove noop_direct_IO as well.

\
 
 \ /
  Last update: 2022-01-24 09:57    [W:0.268 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site