summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2008-11-17 13:10:34 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-12-29 08:28:42 +0100
commit2b91bafcc0fc545e489e9537a38f487706960ea5 (patch)
tree69ebe2bbfef7f95036fab184ff206208438caf43
parent70ed28b92a786f44750ab64117b03d126dd14656 (diff)
downloadlinux-2b91bafcc0fc545e489e9537a38f487706960ea5.tar.bz2
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: Milton Miller <miltonm@bga.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--block/scsi_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index d0bb92cbefb9..ee9c67d7e1be 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -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)
{
- 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)
@@ -68,7 +68,7 @@ static int sg_set_timeout(struct request_queue *q, int __user *p)
int timeout, err = get_user(timeout, p);
if (!err)
- q->sg_timeout = timeout * (HZ / USER_HZ);
+ q->sg_timeout = clock_t_to_jiffies(timeout);
return err;
}