]> www.infradead.org Git - users/hch/misc.git/commitdiff
block: don't bother checking the data direction for merges
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Nov 2024 08:30:07 +0000 (09:30 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Nov 2024 10:34:50 +0000 (11:34 +0100)
Because it already is encoded in the opcode.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-merge.c

index e0b28e9298c9fb5315225e6a1daacc50ba4786fa..64860cbd5e2780a31c20118ab594aac234ebfc0c 100644 (file)
@@ -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)
@@ -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;