Skip to content

Commit b294349

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: 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 xfs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
1 parent 61d7e82 commit b294349

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

fs/xfs/xfs_aops.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ const struct address_space_operations xfs_address_space_operations = {
582582
.release_folio = iomap_release_folio,
583583
.invalidate_folio = iomap_invalidate_folio,
584584
.bmap = xfs_vm_bmap,
585-
.direct_IO = noop_direct_IO,
586585
.migrate_folio = filemap_migrate_folio,
587586
.is_partially_uptodate = iomap_is_partially_uptodate,
588587
.error_remove_page = generic_error_remove_page,
@@ -591,7 +590,6 @@ const struct address_space_operations xfs_address_space_operations = {
591590

592591
const struct address_space_operations xfs_dax_aops = {
593592
.writepages = xfs_dax_writepages,
594-
.direct_IO = noop_direct_IO,
595593
.dirty_folio = noop_dirty_folio,
596594
.swap_activate = xfs_iomap_swapfile_activate,
597595
};

fs/xfs/xfs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ xfs_file_open(
11721172
if (xfs_is_shutdown(XFS_M(inode->i_sb)))
11731173
return -EIO;
11741174
file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
1175-
FMODE_DIO_PARALLEL_WRITE;
1175+
FMODE_DIO_PARALLEL_WRITE | FMODE_CAN_ODIRECT;
11761176
return generic_file_open(inode, file);
11771177
}
11781178

0 commit comments

Comments
 (0)