scsi/osd: open code blk_make_request

I wish the OSD code could simply use blk_rq_map_* helpers like
everyone else, but the complex nature of deciding if we have
DATA IN and/or DATA OUT buffers might make this impossible
(at least for a mere human like me).

But using blk_rq_append_bio at least allows sharing the setup code
between request with or without dat a buffers, and given that this
is the last user of blk_make_request it allows getting rid of that
somewhat awkward interface.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Boaz Harrosh <ooo@electrozaur.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
这个提交包含在:
Christoph Hellwig
2016-07-19 11:31:53 +02:00
提交者 Jens Axboe
父节点 dd9cf04611
当前提交 4613c5f1df
修改 3 个文件,包含 16 行新增68 行删除

查看文件

@@ -1558,18 +1558,25 @@ static int _osd_req_finalize_data_integrity(struct osd_request *or,
static struct request *_make_request(struct request_queue *q, bool has_write,
struct _osd_io_info *oii, gfp_t flags)
{
if (oii->bio)
return blk_make_request(q, oii->bio, flags);
else {
struct request *req;
struct request *req;
struct bio *bio = oii->bio;
int ret;
req = blk_get_request(q, has_write ? WRITE : READ, flags);
if (IS_ERR(req))
return req;
blk_rq_set_block_pc(req);
req = blk_get_request(q, has_write ? WRITE : READ, flags);
if (IS_ERR(req))
return req;
blk_rq_set_block_pc(req);
for_each_bio(bio) {
struct bio *bounce_bio = bio;
blk_queue_bounce(req->q, &bounce_bio);
ret = blk_rq_append_bio(req, bounce_bio);
if (ret)
return ERR_PTR(ret);
}
return req;
}
static int _init_blk_request(struct osd_request *or,