All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Convert jiffies to msecs in scsi_ioctl()
@ 2006-11-09 10:55 Hannes Reinecke
  0 siblings, 0 replies; only message in thread
From: Hannes Reinecke @ 2006-11-09 10:55 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI Mailing List

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

Hi all,

The attached patch fixes the conversion from jiffies to msecs in
scsi_ioctl(). The current code works if HZ=1000, but will lead to 
incorrect timeout settings for other values.

Please apply.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: scsi-ioctl-convert-jiffies-to-msecs --]
[-- Type: text/plain, Size: 668 bytes --]

Fix conversion from jiffies to msecs for sg_io()

Use the proper conversion function for convert jiffies to msecs in
sg_io().

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 2dc3264..ac63964 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -304,7 +304,7 @@ static int sg_io(struct file *file, requ
 	if (rq->bio)
 		blk_queue_bounce(q, &rq->bio);
 
-	rq->timeout = (hdr->timeout * HZ) / 1000;
+	rq->timeout = jiffies_to_msecs(hdr->timeout);
 	if (!rq->timeout)
 		rq->timeout = q->sg_timeout;
 	if (!rq->timeout)
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-09 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-09 10:55 [PATCH] Convert jiffies to msecs in scsi_ioctl() Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.