Skip to content

Commit 54429c9

Browse files
tangyoulingKent Overstreet
authored andcommitted
bcachefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
Since commit a2ad63d ("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 b294349 ("xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method"). Signed-off-by: Youling Tang <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 427ba55 commit 54429c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/bcachefs/fs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,8 @@ static int bch2_open(struct inode *vinode, struct file *file)
11451145
return ret;
11461146
}
11471147

1148+
file->f_mode |= FMODE_CAN_ODIRECT;
1149+
11481150
return generic_file_open(vinode, file);
11491151
}
11501152

@@ -1237,7 +1239,6 @@ static const struct address_space_operations bch_address_space_operations = {
12371239
.write_end = bch2_write_end,
12381240
.invalidate_folio = bch2_invalidate_folio,
12391241
.release_folio = bch2_release_folio,
1240-
.direct_IO = noop_direct_IO,
12411242
#ifdef CONFIG_MIGRATION
12421243
.migrate_folio = filemap_migrate_folio,
12431244
#endif

0 commit comments

Comments
 (0)