Skip to content

Commit f02c75e

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: 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 btrfs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent aadb164 commit f02c75e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/btrfs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3700,7 +3700,8 @@ static int btrfs_file_open(struct inode *inode, struct file *filp)
37003700
{
37013701
int ret;
37023702

3703-
filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC;
3703+
filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
3704+
FMODE_CAN_ODIRECT;
37043705

37053706
ret = fsverity_file_open(inode, filp);
37063707
if (ret)

fs/btrfs/inode.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11011,7 +11011,6 @@ static const struct address_space_operations btrfs_aops = {
1101111011
.read_folio = btrfs_read_folio,
1101211012
.writepages = btrfs_writepages,
1101311013
.readahead = btrfs_readahead,
11014-
.direct_IO = noop_direct_IO,
1101511014
.invalidate_folio = btrfs_invalidate_folio,
1101611015
.release_folio = btrfs_release_folio,
1101711016
.migrate_folio = btrfs_migrate_folio,

0 commit comments

Comments
 (0)