Skip to content

Commit 7b7b06d

Browse files
Christoph HellwigAndreas Gruenbacher
authored andcommitted
gfs2: 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. Remove .direct_IO from gfs2_aops and set FMODE_CAN_ODIRECT in gfs2_open_common for regular files that do not use data journalling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent f9da18c commit 7b7b06d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

fs/gfs2/aops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ static const struct address_space_operations gfs2_aops = {
750750
.release_folio = iomap_release_folio,
751751
.invalidate_folio = iomap_invalidate_folio,
752752
.bmap = gfs2_bmap,
753-
.direct_IO = noop_direct_IO,
754753
.migrate_folio = filemap_migrate_folio,
755754
.is_partially_uptodate = iomap_is_partially_uptodate,
756755
.error_remove_page = generic_error_remove_page,

fs/gfs2/file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,9 @@ int gfs2_open_common(struct inode *inode, struct file *file)
630630
ret = generic_file_open(inode, file);
631631
if (ret)
632632
return ret;
633+
634+
if (!gfs2_is_jdata(GFS2_I(inode)))
635+
file->f_mode |= FMODE_CAN_ODIRECT;
633636
}
634637

635638
fp = kzalloc(sizeof(struct gfs2_file), GFP_NOFS);

0 commit comments

Comments
 (0)