On 2020/7/1 16:59, Christoph Hellwig wrote:
> The make_request_fn is a little weird in that it sits directly in
> struct request_queue instead of an operation vector. Replace it with
> a block_device_operations method called submit_bio (which describes much
> better what it does). Also remove the request_queue argument to it, as
> the queue can be derived pretty trivially from the bio.
>
> Signed-off-by: Christoph Hellwig
For the bcache part,
Acked-by: Coly Li
> ---
> Documentation/block/biodoc.rst| 2 +-
> .../block/writeback_cache_control.rst | 2 +-
> arch/m68k/emu/nfblock.c | 5 +-
> arch/xtensa/platforms/iss/simdisk.c | 5 +-
> block/blk-cgroup.c| 2 +-
> block/blk-core.c | 53 +++
> block/blk-mq.c| 10 ++--
> block/blk.h | 2 -
> drivers/block/brd.c | 5 +-
> drivers/block/drbd/drbd_int.h | 2 +-
> drivers/block/drbd/drbd_main.c| 9 ++--
> drivers/block/drbd/drbd_req.c | 2 +-
> drivers/block/null_blk_main.c | 17 --
> drivers/block/pktcdvd.c | 11 ++--
> drivers/block/ps3vram.c | 15 +++---
> drivers/block/rsxx/dev.c | 7 ++-
> drivers/block/umem.c | 5 +-
> drivers/block/zram/zram_drv.c | 11 ++--
> drivers/lightnvm/core.c | 8 +--
> drivers/lightnvm/pblk-init.c | 12 +++--
> drivers/md/bcache/request.c | 4 +-
> drivers/md/bcache/request.h | 4 +-
> drivers/md/bcache/super.c | 23 +---
> drivers/md/dm.c | 23
> drivers/md/md.c | 5 +-
> drivers/nvdimm/blk.c | 5 +-
> drivers/nvdimm/btt.c | 5 +-
> drivers/nvdimm/pmem.c | 5 +-
> drivers/nvme/host/core.c | 1 +
> drivers/nvme/host/multipath.c | 5 +-
> drivers/nvme/host/nvme.h | 1 +
> drivers/s390/block/dcssblk.c | 9 ++--
> drivers/s390/block/xpram.c| 6 +--
> include/linux/blk-mq.h| 2 +-
> include/linux/blkdev.h| 7 +--
> include/linux/lightnvm.h | 3 +-
> 36 files changed, 153 insertions(+), 140 deletions(-)
>
[snipped]
> diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
> index 7acf024e99f351..fc5702b10074d6 100644
> --- a/drivers/md/bcache/request.c
> +++ b/drivers/md/bcache/request.c
> @@ -1158,7 +1158,7 @@ static void quit_max_writeback_rate(struct cache_set *c,
>
> /* Cached devices - read & write stuff */
>
> -blk_qc_t cached_dev_make_request(struct request_queue *q, struct bio *bio)
> +blk_qc_t cached_dev_submit_bio(struct bio *bio)
> {
> struct search *s;
> struct bcache_device *d = bio->bi_disk->private_data;
> @@ -1291,7 +1291,7 @@ static void flash_dev_nodata(struct closure *cl)
> continue_at(cl, search_free, NULL);
> }
>
> -blk_qc_t flash_dev_make_request(struct request_queue *q, struct bio *bio)
> +blk_qc_t flash_dev_submit_bio(struct bio *bio)
> {
> struct search *s;
> struct closure *cl;
> diff --git a/drivers/md/bcache/request.h b/drivers/md/bcache/request.h
> index bb005c93dd7218..82b38366a95deb 100644
> --- a/drivers/md/bcache/request.h
> +++ b/drivers/md/bcache/request.h
> @@ -37,10 +37,10 @@ unsigned int bch_get_congested(const struct cache_set *c);
> void bch_data_insert(struct closure *cl);
>
> void bch_cached_dev_request_init(struct cached_dev *dc);
> -blk_qc_t cached_dev_make_request(struct request_queue *q, struct bio *bio);
> +blk_qc_t cached_dev_submit_bio(struct bio *bio);
>
> void bch_flash_dev_request_init(struct bcache_device *d);
> -blk_qc_t flash_dev_make_request(struct request_queue *q, struct bio *bio);
> +blk_qc_t flash_dev_submit_bio(struct bio *bio);
>
> extern struct kmem_cache *bch_search_cache;
>
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 21aa168113d30b..de13f6e916966d 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -680,7 +680,16 @@ static int ioctl_dev(struct block_device *b, fmode_t
> mode,
> return d->ioctl(d, mode, cmd, arg);
> }
>
> -static const struct block_device_operations bcache_ops = {
> +static const struct block_device_operations bcache_cached_ops = {
> + .submit_bio = cached_dev_submit_bio,
> + .open = open_dev,
> + .release= release_dev,
> + .ioctl = ioctl_dev,
> + .owner = THIS_MODULE,
> +};
> +
> +static const struct block_device_operations bcache_flash_ops