Skip to content

Commit

Permalink
block: copy bio op to request op
Browse files Browse the repository at this point in the history
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 <mchristi@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Mike Christie authored and Jens Axboe committed Jun 7, 2016
1 parent a022606 commit 4993b77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2976,8 +2976,7 @@ EXPORT_SYMBOL_GPL(__blk_end_request_err);
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
struct bio *bio)
{
/* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw */
rq->cmd_flags |= bio->bi_rw & REQ_WRITE;
req_set_op(rq, bio_op(bio));

if (bio_has_data(bio))
rq->nr_phys_segments = bio_phys_segments(q, bio);
Expand Down Expand Up @@ -3062,7 +3061,8 @@ EXPORT_SYMBOL_GPL(blk_rq_unprep_clone);
static void __blk_rq_prep_clone(struct request *dst, struct request *src)
{
dst->cpu = src->cpu;
dst->cmd_flags |= (src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE;
req_set_op_attrs(dst, req_op(src),
(src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE);
dst->cmd_type = src->cmd_type;
dst->__sector = blk_rq_pos(src);
dst->__data_len = blk_rq_bytes(src);
Expand Down

0 comments on commit 4993b77

Please sign in to comment.