Skip to content

Commit a05f7bd

Browse files
Christoph Hellwigaxboe
authored andcommitted
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>
1 parent 727cfe9 commit a05f7bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

block/fops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ const struct address_space_operations def_blk_aops = {
428428
.writepage = blkdev_writepage,
429429
.write_begin = blkdev_write_begin,
430430
.write_end = blkdev_write_end,
431-
.direct_IO = blkdev_direct_IO,
432431
.migrate_folio = buffer_migrate_folio_norefs,
433432
.is_dirty_writeback = buffer_check_dirty_writeback,
434433
};
@@ -505,7 +504,7 @@ static int blkdev_open(struct inode *inode, struct file *filp)
505504
* during an unstable branch.
506505
*/
507506
filp->f_flags |= O_LARGEFILE;
508-
filp->f_mode |= FMODE_BUF_RASYNC;
507+
filp->f_mode |= FMODE_BUF_RASYNC | FMODE_CAN_ODIRECT;
509508

510509
/*
511510
* Use the file private data to store the holder for exclusive openes.

0 commit comments

Comments
 (0)