]> www.infradead.org Git - users/hch/block.git/commitdiff
block: stop setting ->direct_IO
authorChristoph Hellwig <hch@lst.de>
Sat, 22 Apr 2023 06:01:56 +0000 (08:01 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 22 Apr 2023 13:18:46 +0000 (15:18 +0200)
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>
block/fops.c

index fd510b6142bd577f79a4419fc65f76e953e7a6cc..318247832a7bcfed7c7f144b4c006e57225b0bcb 100644 (file)
@@ -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,
 };
@@ -481,7 +480,7 @@ static int blkdev_open(struct inode *inode, struct file *filp)
         * during an unstable branch.
         */
        filp->f_flags |= O_LARGEFILE;
-       filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
+       filp->f_mode |= FMODE_CAN_ODIRECT | FMODE_NOWAIT | FMODE_BUF_RASYNC;
 
        if (filp->f_flags & O_NDELAY)
                filp->f_mode |= FMODE_NDELAY;