Message ID | 20230612053711.585847-1-hch@lst.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [f2fs-dev] f2fs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method | expand |
On 2023/6/12 13:37, Christoph Hellwig wrote: > 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 f2fs so that noop_direct_IO can eventually be removed. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 7165b1202f539c..5e90416f64daa1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -4067,7 +4067,6 @@ const struct address_space_operations f2fs_dblock_aops = { .migrate_folio = filemap_migrate_folio, .invalidate_folio = f2fs_invalidate_folio, .release_folio = f2fs_release_folio, - .direct_IO = noop_direct_IO, .bmap = f2fs_bmap, .swap_activate = f2fs_swap_activate, .swap_deactivate = f2fs_swap_deactivate, diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 5ac53d2627d20d..ca809e366cb79f 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -547,6 +547,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp) return err; filp->f_mode |= FMODE_NOWAIT; + filp->f_mode |= FMODE_CAN_ODIRECT; return dquot_file_open(inode, filp); }
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 f2fs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/f2fs/data.c | 1 - fs/f2fs/file.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)