linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-block@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-scsi@vger.kernel.org
Subject: [PATCH 2/5] block: don't check ->rq_disk in merges
Date: Tue, 28 Sep 2021 07:22:08 +0200	[thread overview]
Message-ID: <20210928052211.112801-3-hch@lst.de> (raw)
In-Reply-To: <20210928052211.112801-1-hch@lst.de>

There is a 1:1 relationship between request_queues and gendisks now, so
no need for these extra checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-merge.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 5b4f23014df8a..6b62415452f82 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -756,8 +756,7 @@ static struct request *attempt_merge(struct request_queue *q,
 	if (req_op(req) != req_op(next))
 		return NULL;
 
-	if (rq_data_dir(req) != rq_data_dir(next)
-	    || req->rq_disk != next->rq_disk)
+	if (rq_data_dir(req) != rq_data_dir(next))
 		return NULL;
 
 	if (req_op(req) == REQ_OP_WRITE_SAME &&
@@ -884,10 +883,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
 	if (bio_data_dir(bio) != rq_data_dir(rq))
 		return false;
 
-	/* must be same device */
-	if (rq->rq_disk != bio->bi_bdev->bd_disk)
-		return false;
-
 	/* only merge integrity protected bio into ditto rq */
 	if (blk_integrity_merge_bio(rq->q, rq, bio) == false)
 		return false;
-- 
2.30.2


  parent reply	other threads:[~2021-09-28  5:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  5:22 remove ->rq_disk Christoph Hellwig
2021-09-28  5:22 ` [PATCH 1/5] mtd_blkdevs: remove the sector out of range check in do_blktrans_request Christoph Hellwig
2021-09-28  8:51   ` Miquel Raynal
2021-09-28  5:22 ` Christoph Hellwig [this message]
2021-09-28  5:22 ` [PATCH 3/5] block: remove the ->rq_disk field in struct request Christoph Hellwig
2021-09-28 21:11   ` Chaitanya Kulkarni
2021-09-28 21:21     ` Chaitanya Kulkarni
2021-09-28 21:22   ` Chaitanya Kulkarni
2021-09-28  5:22 ` [PATCH 4/5] block: remove the gendisk argument to blk_execute_rq Christoph Hellwig
2021-09-28 21:23   ` Chaitanya Kulkarni
2021-09-28  5:22 ` [PATCH 5/5] scsi: remove the gendisk argument to scsi_ioctl Christoph Hellwig
2021-09-28 21:24   ` Chaitanya Kulkarni
2021-09-28 14:32 ` remove ->rq_disk Ming Lei
2021-09-29  7:07   ` Christoph Hellwig
2021-09-29  8:04     ` Ming Lei
  -- strict thread matches above, loose matches on Subject: below --
2021-11-26 12:17 remove ->rq_disk v2 Christoph Hellwig
2021-11-26 12:17 ` [PATCH 2/5] block: don't check ->rq_disk in merges Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210928052211.112801-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).