summaryrefslogtreecommitdiffstats
path: root/block/fops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-08-01 19:21:59 +0200
committerJens Axboe <axboe@kernel.dk>2023-08-02 17:13:09 +0200
commita05f7bd9578b17521a9a5f3689f3934c082c6390 (patch)
tree702718c15cad0af6a524c3dbc461c6bd5b9bbe60 /block/fops.c
parentblock: open code __generic_file_write_iter for blkdev writes (diff)
downloadlinux-a05f7bd9578b17521a9a5f3689f3934c082c6390.tar.xz
linux-a05f7bd9578b17521a9a5f3689f3934c082c6390.zip
block: stop setting ->direct_IO
Direct I/O on block devices now nevers goes through aops->direct_IO. Stop setting it and set the FMODE_CAN_ODIRECT in ->open instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20230801172201.1923299-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/fops.c')
-rw-r--r--block/fops.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/fops.c b/block/fops.c
index 8a05d99166e3..f0b822c28ddf 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -428,7 +428,6 @@ const struct address_space_operations def_blk_aops = {
.writepage = blkdev_writepage,
.write_begin = blkdev_write_begin,
.write_end = blkdev_write_end,
- .direct_IO = blkdev_direct_IO,
.migrate_folio = buffer_migrate_folio_norefs,
.is_dirty_writeback = buffer_check_dirty_writeback,
};
@@ -505,7 +504,7 @@ static int blkdev_open(struct inode *inode, struct file *filp)
* during an unstable branch.
*/
filp->f_flags |= O_LARGEFILE;
- filp->f_mode |= FMODE_BUF_RASYNC;
+ filp->f_mode |= FMODE_BUF_RASYNC | FMODE_CAN_ODIRECT;
/*
* Use the file private data to store the holder for exclusive openes.