direct-io: remove blk_poll support
authorChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 11:12:11 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:35 +0000 (06:17 -0600)
The polling support in the legacy direct-io support is a little crufty.
It already doesn't support the asynchronous polling needed for io_uring
polling, and is hard to adopt to upcoming changes in the polling
interfaces.  Given that all the major file systems already use the iomap
direct I/O code, just drop the polling support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Mark Wunderlich <mark.wunderlich@intel.com>
Link: https://lore.kernel.org/r/20211012111226.760968-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/direct-io.c

index b2e86e739d7a12294141d82c6bb2f36212997967..453dcff0e7f56617e6f52f3729f6adfe13afbfd4 100644 (file)
@@ -119,7 +119,6 @@ struct dio {
        int flags;                      /* doesn't change */
        int op;
        int op_flags;
-       blk_qc_t bio_cookie;
        struct gendisk *bio_disk;
        struct inode *inode;
        loff_t i_size;                  /* i_size when submitted */
@@ -438,11 +437,10 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio)
 
        dio->bio_disk = bio->bi_bdev->bd_disk;
 
-       if (sdio->submit_io) {
+       if (sdio->submit_io)
                sdio->submit_io(bio, dio->inode, sdio->logical_offset_in_bio);
-               dio->bio_cookie = BLK_QC_T_NONE;
-       } else
-               dio->bio_cookie = submit_bio(bio);
+       else
+               submit_bio(bio);
 
        sdio->bio = NULL;
        sdio->boundary = 0;
@@ -481,9 +479,7 @@ static struct bio *dio_await_one(struct dio *dio)
                __set_current_state(TASK_UNINTERRUPTIBLE);
                dio->waiter = current;
                spin_unlock_irqrestore(&dio->bio_lock, flags);
-               if (!(dio->iocb->ki_flags & IOCB_HIPRI) ||
-                   !blk_poll(dio->bio_disk->queue, dio->bio_cookie, true))
-                       blk_io_schedule();
+               blk_io_schedule();
                /* wake up sets us TASK_RUNNING */
                spin_lock_irqsave(&dio->bio_lock, flags);
                dio->waiter = NULL;
@@ -1214,8 +1210,6 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
        } else {
                dio->op = REQ_OP_READ;
        }
-       if (iocb->ki_flags & IOCB_HIPRI)
-               dio->op_flags |= REQ_HIPRI;
 
        /*
         * For AIO O_(D)SYNC writes we need to defer completions to a workqueue