Skip to content

Commit

Permalink
block: don't bother checking the data direction for merges
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 20, 2024
1 parent dcbb598 commit 9f8d682
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,6 @@ 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))
return NULL;

if (req->bio && next->bio) {
/* Don't merge requests with different write hints. */
if (req->bio->bi_write_hint != next->bio->bi_write_hint)
Expand Down Expand Up @@ -986,10 +983,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
if (req_op(rq) != bio_op(bio))
return false;

/* different data direction or already started, don't merge */
if (bio_data_dir(bio) != rq_data_dir(rq))
return false;

/* don't merge across cgroup boundaries */
if (!blk_cgroup_mergeable(rq, bio))
return false;
Expand Down

0 comments on commit 9f8d682

Please sign in to comment.