]> err.no Git - linux-2.6/commitdiff
ub: add sg_init_table for sense and read capacity commands
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Thu, 25 Oct 2007 07:17:03 +0000 (09:17 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 25 Oct 2007 07:17:03 +0000 (09:17 +0200)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/ub.c

index 5e740e14ab351de7deddda3f2fd2308b4bb32b02..08e909dc7944f9b85ec98d2db49e9f275859b6ae 100644 (file)
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
        scmd->state = UB_CMDST_INIT;
        scmd->nsg = 1;
        sg = &scmd->sgv[0];
+       sg_init_table(sg, UB_MAX_REQ_SG);
        sg_set_page(sg, virt_to_page(sc->top_sense), UB_SENSE_SIZE,
                        (unsigned long)sc->top_sense & (PAGE_SIZE-1));
        scmd->len = UB_SENSE_SIZE;
@@ -1863,6 +1864,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
        cmd->state = UB_CMDST_INIT;
        cmd->nsg = 1;
        sg = &cmd->sgv[0];
+       sg_init_table(sg, UB_MAX_REQ_SG);
        sg_set_page(sg, virt_to_page(p), 8, (unsigned long)p & (PAGE_SIZE-1));
        cmd->len = 8;
        cmd->lun = lun;