btrfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
PATCH 1/1 btrfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for btrfs so that noop_direct_IO can eventually be removed.
--- fs/btrfs/file.c | 1 + fs/btrfs/inode.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/file.c +1 -0
@@ -3710,6 +3710,7 @@ static int btrfs_file_open(struct inode *inode, struct file *filp)int ret; filp->f_mode |=FMODE_NOWAIT |FMODE_BUF_RASYNC |FMODE_BUF_WASYNC ; + filp->f_mode |=FMODE_CAN_ODIRECT ; ret =fsverity_file_open (inode, filp);if (ret)
fs/btrfs/inode.c +0 -1
@@ -10903,7 +10903,6 @@ static const struct address_space_operations btrfs_aops = { .read_folio = btrfs_read_folio, .writepages = btrfs_writepages, .readahead = btrfs_readahead, - .direct_IO = noop_direct_IO, .invalidate_folio = btrfs_invalidate_folio, .release_folio = btrfs_release_folio, .migrate_folio = btrfs_migrate_folio,
Signature · 1 line
2.39.2
Quoted 6 lines · Christoph Hellwig
Since commit
a2ad63daa88b("VFS: addFMODE_CAN_ODIRECTfile flag") file systems can just set theFMODE_CAN_ODIRECTflag at open time instead of wiring up a dummydirect_IOmethod to indicate support for direct I/O. Do that for btrfs so thatnoop_direct_IOcan eventually be removed.Signed-off-by Christoph Hellwig <[email protected]>
Added to misc-next, thanks. Seems that a few more filesystem can use the same conversion.
Quoted 10 lines · David Sterba
Quoted 6 lines · Christoph Hellwig
Since commit
a2ad63daa88b("VFS: addFMODE_CAN_ODIRECTfile flag") file systems can just set theFMODE_CAN_ODIRECTflag at open time instead of wiring up a dummydirect_IOmethod to indicate support for direct I/O. Do that for btrfs so thatnoop_direct_IOcan eventually be removed.Signed-off-by Christoph Hellwig <[email protected]>Added to misc-next, thanks. Seems that a few more filesystem can use the same conversion.
Yes. I have a few more patches, but not all are as trivial.