Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24bb8fb99a062213424d3e88842eb07f693378be
Commit:     24bb8fb99a062213424d3e88842eb07f693378be
Parent:     c63a1190368771b8207d86c4217ae4afdf1cbd5e
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 5 21:28:24 2007 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Dec 18 08:29:28 2007 +0100

    block: use jiffies conversion functions in scsi_ioctl.c
    
    Use msecs_to_jiffies() and jiffies_to_msecs() in scsi_ioctl().
    Sometimes callers use very large values for e.g. vendor specific media
    clear command and calculation can overflow.
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/scsi_ioctl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 91c7322..9675b34 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -230,7 +230,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 +366,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:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to