提交 febf7158 编写于 作者: K Keith Busch 提交者: Jens Axboe

block: require blk_rq_prep_clone() be given an initialized clone request

Prepare to allow blk_rq_prep_clone() to accept clone requests that were
allocated from blk-mq request queues.  As such the blk_rq_prep_clone()
caller must first initialize the clone request.
Signed-off-by: NKeith Busch <keith.busch@intel.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 24391c0d
...@@ -2945,8 +2945,6 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src, ...@@ -2945,8 +2945,6 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
if (!bs) if (!bs)
bs = fs_bio_set; bs = fs_bio_set;
blk_rq_init(NULL, rq);
__rq_for_each_bio(bio_src, rq_src) { __rq_for_each_bio(bio_src, rq_src) {
bio = bio_clone_fast(bio_src, gfp_mask, bs); bio = bio_clone_fast(bio_src, gfp_mask, bs);
if (!bio) if (!bio)
......
...@@ -1719,6 +1719,7 @@ static int setup_clone(struct request *clone, struct request *rq, ...@@ -1719,6 +1719,7 @@ static int setup_clone(struct request *clone, struct request *rq,
{ {
int r; int r;
blk_rq_init(NULL, rq);
r = blk_rq_prep_clone(clone, rq, tio->md->bs, GFP_ATOMIC, r = blk_rq_prep_clone(clone, rq, tio->md->bs, GFP_ATOMIC,
dm_rq_bio_constructor, tio); dm_rq_bio_constructor, tio);
if (r) if (r)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册