Commit 3e90417f authored by Ritesh Harjani (IBM)'s avatar Ritesh Harjani (IBM) Committed by Jan Kara

ext2: 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.
Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <94f78492f55c3f421359fb6e0d8fab6e79ea17b2.1709215665.git.ritesh.list@gmail.com>
parent 94755a00
...@@ -302,6 +302,12 @@ static ssize_t ext2_file_write_iter(struct kiocb *iocb, struct iov_iter *from) ...@@ -302,6 +302,12 @@ static ssize_t ext2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
return generic_file_write_iter(iocb, from); return generic_file_write_iter(iocb, from);
} }
static int ext2_file_open(struct inode *inode, struct file *filp)
{
filp->f_mode |= FMODE_CAN_ODIRECT;
return dquot_file_open(inode, filp);
}
const struct file_operations ext2_file_operations = { const struct file_operations ext2_file_operations = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
.read_iter = ext2_file_read_iter, .read_iter = ext2_file_read_iter,
...@@ -311,7 +317,7 @@ const struct file_operations ext2_file_operations = { ...@@ -311,7 +317,7 @@ const struct file_operations ext2_file_operations = {
.compat_ioctl = ext2_compat_ioctl, .compat_ioctl = ext2_compat_ioctl,
#endif #endif
.mmap = ext2_file_mmap, .mmap = ext2_file_mmap,
.open = dquot_file_open, .open = ext2_file_open,
.release = ext2_release_file, .release = ext2_release_file,
.fsync = ext2_fsync, .fsync = ext2_fsync,
.get_unmapped_area = thp_get_unmapped_area, .get_unmapped_area = thp_get_unmapped_area,
......
...@@ -965,7 +965,6 @@ const struct address_space_operations ext2_aops = { ...@@ -965,7 +965,6 @@ const struct address_space_operations ext2_aops = {
.write_begin = ext2_write_begin, .write_begin = ext2_write_begin,
.write_end = ext2_write_end, .write_end = ext2_write_end,
.bmap = ext2_bmap, .bmap = ext2_bmap,
.direct_IO = noop_direct_IO,
.writepages = ext2_writepages, .writepages = ext2_writepages,
.migrate_folio = buffer_migrate_folio, .migrate_folio = buffer_migrate_folio,
.is_partially_uptodate = block_is_partially_uptodate, .is_partially_uptodate = block_is_partially_uptodate,
...@@ -974,7 +973,6 @@ const struct address_space_operations ext2_aops = { ...@@ -974,7 +973,6 @@ const struct address_space_operations ext2_aops = {
static const struct address_space_operations ext2_dax_aops = { static const struct address_space_operations ext2_dax_aops = {
.writepages = ext2_dax_writepages, .writepages = ext2_dax_writepages,
.direct_IO = noop_direct_IO,
.dirty_folio = noop_dirty_folio, .dirty_folio = noop_dirty_folio,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment