diff mbox series

[02/16] block: convert leftovers to bdev_get_queue

Message ID 654f1cba1fe9c321cb87943ee33a21c7ea3d8e65.1634676157.git.asml.silence@gmail.com (mailing list archive)
State New, archived
Headers show
Series block optimisation round | expand

Commit Message

Pavel Begunkov Oct. 19, 2021, 9:24 p.m. UTC
Convert bdev->bd_disk->queue to bdev_get_queue(), which is faster.
Apparently, there are a few such spots in block that got lost during
rebases.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 block/blk-core.c  | 2 +-
 block/blk-merge.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Chaitanya Kulkarni Oct. 19, 2021, 10:34 p.m. UTC | #1
On 10/19/21 2:24 PM, Pavel Begunkov wrote:
> External email: Use caution opening links or attachments
> 
> 
> Convert bdev->bd_disk->queue to bdev_get_queue(), which is faster.
> Apparently, there are a few such spots in block that got lost during
> rebases.
> 
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index e6ad5b51d0c3..c1ba34777c6d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1080,7 +1080,7 @@  EXPORT_SYMBOL(submit_bio);
  */
 int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
 {
-	struct request_queue *q = bio->bi_bdev->bd_disk->queue;
+	struct request_queue *q = bdev_get_queue(bio->bi_bdev);
 	blk_qc_t cookie = READ_ONCE(bio->bi_cookie);
 	int ret;
 
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 3e6fa449caff..df69f4bb7717 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -383,7 +383,7 @@  void __blk_queue_split(struct request_queue *q, struct bio **bio,
  */
 void blk_queue_split(struct bio **bio)
 {
-	struct request_queue *q = (*bio)->bi_bdev->bd_disk->queue;
+	struct request_queue *q = bdev_get_queue((*bio)->bi_bdev);
 	unsigned int nr_segs;
 
 	if (blk_may_split(q, *bio))