bcachefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
PATCH 1/1 bcachefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
From: Youling Tang <[email protected]>
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 bcachefs so that noop_direct_IO can eventually be removed.
Similar to commit b29434999371 ("xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method").
--- fs/bcachefs/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/bcachefs/fs.c +2 -1
@@ -1142,6 +1142,8 @@ static int bch2_open(struct inode *vinode, struct file *file)return ret; } + file->f_mode |=FMODE_CAN_ODIRECT ; +return generic_file_open (vinode, file); }
@@ -1234,7 +1236,6 @@ static const struct address_space_operations bch_address_space_operations = { .write_end = bch2_write_end, .invalidate_folio = bch2_invalidate_folio, .release_folio = bch2_release_folio, - .direct_IO = noop_direct_IO,#ifdef CONFIG_MIGRATION .migrate_folio = filemap_migrate_folio,#endif
Signature · 1 line
2.34.1
Quoted 7 lines · Youling Tang
From: Youling Tang <[email protected]>
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 bcachefs so thatnoop_direct_IOcan eventually be removed.
Quoted 5 lines
Similar to commit
b29434999371("xfs: setFMODE_CAN_ODIRECTinstead of a dummydirect_IOmethod").Signed-off-by Youling Tang <[email protected]>---
Seems straightforward:
Quoted 28 lines
fs/bcachefs/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/bcachefs/fs.c +2
-1@@ -1142,6 +1142,8 @@ static int bch2_open(struct inode *vinode, struct file *file)return ret; } + file->f_mode |=FMODE_CAN_ODIRECT ; +return generic_file_open (vinode, file); }@@ -1234,7 +1236,6 @@ static const struct address_space_operations bch_address_space_operations = { .write_end = bch2_write_end, .invalidate_folio = bch2_invalidate_folio, .release_folio = bch2_release_folio, - .direct_IO = noop_direct_IO,#ifdef CONFIG_MIGRATION .migrate_folio = filemap_migrate_folio,#endif Signature · 1 line
2.34.1