Commit 2b91bafc authored by Milton Miller's avatar Milton Miller Committed by Jens Axboe

scsi-ioctl: use clock_t <> jiffies

Convert the timeout ioctl scalling to use the clock_t functions
which are much more accurate with some USER_HZ vs HZ combinations.
Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 70ed28b9
...@@ -60,7 +60,7 @@ static int scsi_get_bus(struct request_queue *q, int __user *p) ...@@ -60,7 +60,7 @@ static int scsi_get_bus(struct request_queue *q, int __user *p)
static int sg_get_timeout(struct request_queue *q) static int sg_get_timeout(struct request_queue *q)
{ {
return q->sg_timeout / (HZ / USER_HZ); return jiffies_to_clock_t(q->sg_timeout);
} }
static int sg_set_timeout(struct request_queue *q, int __user *p) static int sg_set_timeout(struct request_queue *q, int __user *p)
...@@ -68,7 +68,7 @@ static int sg_set_timeout(struct request_queue *q, int __user *p) ...@@ -68,7 +68,7 @@ static int sg_set_timeout(struct request_queue *q, int __user *p)
int timeout, err = get_user(timeout, p); int timeout, err = get_user(timeout, p);
if (!err) if (!err)
q->sg_timeout = timeout * (HZ / USER_HZ); q->sg_timeout = clock_t_to_jiffies(timeout);
return err; return err;
} }
......
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