block: switch polling to be bio based
authorChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 11:12:24 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:36 +0000 (06:17 -0600)
commit3e08773c3841e9db7a520908cc2b136a77d275ff
tree5dce4a3944899f0eb1370a92130e89134da2a714
parent19416123ab3e1348b3532347af221d8f60838431
block: switch polling to be bio based

Replace the blk_poll interface that requires the caller to keep a queue
and cookie from the submissions with polling based on the bio.

Polling for the bio itself leads to a few advantages:

 - the cookie construction can made entirely private in blk-mq.c
 - the caller does not need to remember the request_queue and cookie
   separately and thus sidesteps their lifetime issues
 - keeping the device and the cookie inside the bio allows to trivially
   support polling BIOs remapping by stacking drivers
 - a lot of code to propagate the cookie back up the submission path can
   be removed entirely.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Mark Wunderlich <mark.wunderlich@intel.com>
Link: https://lore.kernel.org/r/20211012111226.760968-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
39 files changed:
arch/m68k/emu/nfblock.c
arch/xtensa/platforms/iss/simdisk.c
block/bio.c
block/blk-core.c
block/blk-exec.c
block/blk-mq.c
block/blk-mq.h
block/fops.c
drivers/block/brd.c
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_req.c
drivers/block/n64cart.c
drivers/block/null_blk/main.c
drivers/block/pktcdvd.c
drivers/block/ps3vram.c
drivers/block/rsxx/dev.c
drivers/block/zram/zram_drv.c
drivers/md/bcache/request.c
drivers/md/bcache/request.h
drivers/md/dm.c
drivers/md/md.c
drivers/nvdimm/blk.c
drivers/nvdimm/btt.c
drivers/nvdimm/pmem.c
drivers/nvme/host/multipath.c
drivers/s390/block/dcssblk.c
fs/btrfs/inode.c
fs/ext4/file.c
fs/gfs2/file.c
fs/iomap/direct-io.c
fs/xfs/xfs_file.c
fs/zonefs/super.c
include/linux/bio.h
include/linux/blk-mq.h
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/fs.h
include/linux/iomap.h
mm/page_io.c