Skip to content

Commit 9f8d682

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: don't bother checking the data direction for merges
Because it already is encoded in the opcode. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20241119161157.1328171-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent dcbb598 commit 9f8d682

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

block/blk-merge.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,6 @@ static struct request *attempt_merge(struct request_queue *q,
864864
if (req_op(req) != req_op(next))
865865
return NULL;
866866

867-
if (rq_data_dir(req) != rq_data_dir(next))
868-
return NULL;
869-
870867
if (req->bio && next->bio) {
871868
/* Don't merge requests with different write hints. */
872869
if (req->bio->bi_write_hint != next->bio->bi_write_hint)
@@ -986,10 +983,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
986983
if (req_op(rq) != bio_op(bio))
987984
return false;
988985

989-
/* different data direction or already started, don't merge */
990-
if (bio_data_dir(bio) != rq_data_dir(rq))
991-
return false;
992-
993986
/* don't merge across cgroup boundaries */
994987
if (!blk_cgroup_mergeable(rq, bio))
995988
return false;

0 commit comments

Comments
 (0)