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 <[email protected]>
Acked-by: Boaz Harrosh <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Christoph Hellwig 2016-07-19 11:31:53 +02:00 • committed by Jens Axboe
commit 4613c5f1df
3 changed files with 16 additions and 68 deletions

View file

@ -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,