Commit 541645be authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Linus Torvalds

ub: fix up the conversion to sg_init_table()

Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Cc: "Oliver Pinter" <oliver.pntr@gmail.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f6a4c8bd
...@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq) ...@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
if ((cmd = ub_get_cmd(lun)) == NULL) if ((cmd = ub_get_cmd(lun)) == NULL)
return -1; return -1;
memset(cmd, 0, sizeof(struct ub_scsi_cmd)); memset(cmd, 0, sizeof(struct ub_scsi_cmd));
sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
blkdev_dequeue_request(rq); blkdev_dequeue_request(rq);
...@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq) ...@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
/* /*
* get scatterlist from block layer * get scatterlist from block layer
*/ */
sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]); n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
if (n_elem < 0) { if (n_elem < 0) {
/* Impossible, because blk_rq_map_sg should not hit ENOMEM. */ /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment