Commit 7b7b06d5 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Andreas Gruenbacher
Browse files

gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method



Since commit a2ad63da ("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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent f9da18cd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -750,7 +750,6 @@ static const struct address_space_operations gfs2_aops = {
	.release_folio = iomap_release_folio,
	.invalidate_folio = iomap_invalidate_folio,
	.bmap = gfs2_bmap,
	.direct_IO = noop_direct_IO,
	.migrate_folio = filemap_migrate_folio,
	.is_partially_uptodate = iomap_is_partially_uptodate,
	.error_remove_page = generic_error_remove_page,
+3 −0
Original line number Diff line number Diff line
@@ -630,6 +630,9 @@ int gfs2_open_common(struct inode *inode, struct file *file)
		ret = generic_file_open(inode, file);
		if (ret)
			return ret;

		if (!gfs2_is_jdata(GFS2_I(inode)))
			file->f_mode |= FMODE_CAN_ODIRECT;
	}

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