Commit 54429c90 authored by Youling Tang's avatar Youling Tang Committed by Kent Overstreet

bcachefs: 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 bcachefs so that noop_direct_IO can eventually be removed.

Similar to commit b2943499 ("xfs: set FMODE_CAN_ODIRECT instead of
a dummy direct_IO method").
Signed-off-by: default avatarYouling Tang <tangyouling@kylinos.cn>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 427ba555
...@@ -1145,6 +1145,8 @@ static int bch2_open(struct inode *vinode, struct file *file) ...@@ -1145,6 +1145,8 @@ static int bch2_open(struct inode *vinode, struct file *file)
return ret; return ret;
} }
file->f_mode |= FMODE_CAN_ODIRECT;
return generic_file_open(vinode, file); return generic_file_open(vinode, file);
} }
...@@ -1237,7 +1239,6 @@ static const struct address_space_operations bch_address_space_operations = { ...@@ -1237,7 +1239,6 @@ static const struct address_space_operations bch_address_space_operations = {
.write_end = bch2_write_end, .write_end = bch2_write_end,
.invalidate_folio = bch2_invalidate_folio, .invalidate_folio = bch2_invalidate_folio,
.release_folio = bch2_release_folio, .release_folio = bch2_release_folio,
.direct_IO = noop_direct_IO,
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
.migrate_folio = filemap_migrate_folio, .migrate_folio = filemap_migrate_folio,
#endif #endif
......
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