Skip to content

Commit

Permalink
scsi-ioctl: use clock_t <> jiffies
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Milton Miller authored and Jens Axboe committed Dec 29, 2008
1 parent 70ed28b commit 2b91baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ 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)
{
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;
}
Expand Down

0 comments on commit 2b91baf

Please sign in to comment.