cfq-iosched: fix RCU problem in cfq_cic_lookup()
[safe/jmp/linux-2.6] / block / scsi_ioctl.c
index 91c7322..78199c0 100644 (file)
 #include <scsi/scsi_cmnd.h>
 
 /* Command group 3 is reserved and should never be used.  */
-const unsigned char scsi_command_size[8] =
+const unsigned char scsi_command_size_tbl[8] =
 {
        6, 10, 10, 12,
        16, 12, 10, 10
 };
-
-EXPORT_SYMBOL(scsi_command_size);
+EXPORT_SYMBOL(scsi_command_size_tbl);
 
 #include <scsi/sg.h>
 
@@ -217,8 +216,6 @@ EXPORT_SYMBOL_GPL(blk_verify_command);
 static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
                             struct sg_io_hdr *hdr, int has_write_perm)
 {
-       memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
-
        if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len))
                return -EFAULT;
        if (blk_verify_command(rq->cmd, has_write_perm))
@@ -230,7 +227,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
        rq->cmd_len = hdr->cmd_len;
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
 
-       rq->timeout = (hdr->timeout * HZ) / 1000;
+       rq->timeout = msecs_to_jiffies(hdr->timeout);
        if (!rq->timeout)
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
@@ -366,7 +363,7 @@ static int sg_io(struct file *file, struct request_queue *q,
         */
        blk_execute_rq(q, bd_disk, rq, 0);
 
-       hdr->duration = ((jiffies - start_time) * 1000) / HZ;
+       hdr->duration = jiffies_to_msecs(jiffies - start_time);
 
        return blk_complete_sghdr_rq(rq, hdr, bio);
 out:
@@ -529,8 +526,8 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
        rq->data = NULL;
        rq->data_len = 0;
+       rq->extra_len = 0;
        rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
-       memset(rq->cmd, 0, sizeof(rq->cmd));
        rq->cmd[0] = cmd;
        rq->cmd[4] = data;
        rq->cmd_len = 6;