Skip to content

Commit 4993b77

Browse files
Mike Christieaxboe
authored andcommitted
block: copy bio op to request op
The bio users should now always be setting up the bio op. This patch has the block layer copy that to the request. Signed-off-by: Mike Christie <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent a022606 commit 4993b77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

block/blk-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,8 +2976,7 @@ EXPORT_SYMBOL_GPL(__blk_end_request_err);
29762976
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
29772977
struct bio *bio)
29782978
{
2979-
/* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw */
2980-
rq->cmd_flags |= bio->bi_rw & REQ_WRITE;
2979+
req_set_op(rq, bio_op(bio));
29812980

29822981
if (bio_has_data(bio))
29832982
rq->nr_phys_segments = bio_phys_segments(q, bio);
@@ -3062,7 +3061,8 @@ EXPORT_SYMBOL_GPL(blk_rq_unprep_clone);
30623061
static void __blk_rq_prep_clone(struct request *dst, struct request *src)
30633062
{
30643063
dst->cpu = src->cpu;
3065-
dst->cmd_flags |= (src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE;
3064+
req_set_op_attrs(dst, req_op(src),
3065+
(src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE);
30663066
dst->cmd_type = src->cmd_type;
30673067
dst->__sector = blk_rq_pos(src);
30683068
dst->__data_len = blk_rq_bytes(src);

0 commit comments

Comments
 (0)