@@ -582,6 +582,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
bio->bi_bdev = bio_src->bi_bdev;
bio_set_flag(bio, BIO_CLONED);
bio->bi_rw = bio_src->bi_rw;
+ bio->bi_op = bio_src->bi_op;
bio->bi_iter = bio_src->bi_iter;
bio->bi_io_vec = bio_src->bi_io_vec;
}
@@ -664,6 +665,7 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
bio->bi_bdev = bio_src->bi_bdev;
bio->bi_rw = bio_src->bi_rw;
+ bio->bi_op = bio_src->bi_op;
bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector;
bio->bi_iter.bi_size = bio_src->bi_iter.bi_size;
@@ -1168,8 +1170,10 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
if (!bio)
goto out_bmd;
- if (iter->type & WRITE)
+ if (iter->type & WRITE) {
bio->bi_rw |= REQ_WRITE;
+ bio->bi_op = REQ_OP_WRITE;
+ }
ret = 0;
@@ -1338,8 +1342,10 @@ struct bio *bio_map_user_iov(struct request_queue *q,
/*
* set data direction, and check if mapped pages need bouncing
*/
- if (iter->type & WRITE)
+ if (iter->type & WRITE) {
bio->bi_rw |= REQ_WRITE;
+ bio->bi_op = REQ_OP_WRITE;
+ }
bio_set_flag(bio, BIO_USER_MAPPED);
@@ -1533,6 +1539,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len,
} else {
bio->bi_end_io = bio_copy_kern_endio;
bio->bi_rw |= REQ_WRITE;
+ bio->bi_op = REQ_OP_WRITE;
}
return bio;
@@ -1988,6 +1988,7 @@ EXPORT_SYMBOL(generic_make_request);
void submit_bio(int op, int flags, struct bio *bio)
{
bio->bi_rw |= op | flags;
+ bio->bi_op = op;
/*
* If it's a regular read/write or a barrier with data attached,
@@ -223,8 +223,10 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (IS_ERR(bio))
return PTR_ERR(bio);
- if (!reading)
+ if (!reading) {
bio->bi_rw |= REQ_WRITE;
+ bio->bi_op = REQ_OP_WRITE;
+ }
if (do_copy)
rq->cmd_flags |= REQ_COPY_USER;
@@ -48,9 +48,15 @@ struct bio {
struct block_device *bi_bdev;
unsigned int bi_flags; /* status, command, etc */
int bi_error;
- unsigned long bi_rw; /* bottom bits READ/WRITE,
+ unsigned long bi_rw; /* bottom bits rq_flags_bits
* top bits priority
*/
+ /*
+ * this will be a u8 in the next patches and bi_rw can be shrunk to
+ * a u32. For compat in these transistional patches op is a int here.
+ */
+ int bi_op; /* REQ_OP */
+
struct bvec_iter bi_iter;