Commit 8812387d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Damien Le Moal

zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method

Since commit a2ad63da ("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 zonefs so that noop_direct_IO can eventually be removed.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
parent 16d7fd3c
...@@ -181,7 +181,6 @@ const struct address_space_operations zonefs_file_aops = { ...@@ -181,7 +181,6 @@ const struct address_space_operations zonefs_file_aops = {
.migrate_folio = filemap_migrate_folio, .migrate_folio = filemap_migrate_folio,
.is_partially_uptodate = iomap_is_partially_uptodate, .is_partially_uptodate = iomap_is_partially_uptodate,
.error_remove_page = generic_error_remove_page, .error_remove_page = generic_error_remove_page,
.direct_IO = noop_direct_IO,
.swap_activate = zonefs_swap_activate, .swap_activate = zonefs_swap_activate,
}; };
...@@ -815,6 +814,7 @@ static int zonefs_file_open(struct inode *inode, struct file *file) ...@@ -815,6 +814,7 @@ static int zonefs_file_open(struct inode *inode, struct file *file)
{ {
int ret; int ret;
file->f_mode |= FMODE_CAN_ODIRECT;
ret = generic_file_open(inode, file); ret = generic_file_open(inode, file);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment