aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index ab3c71869be5..7f618ee5ecea 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -560,12 +560,15 @@ sdev_rd_attr (vendor, "%.8s\n");
560sdev_rd_attr (model, "%.16s\n"); 560sdev_rd_attr (model, "%.16s\n");
561sdev_rd_attr (rev, "%.4s\n"); 561sdev_rd_attr (rev, "%.4s\n");
562 562
563/*
564 * TODO: can we make these symlinks to the block layer ones?
565 */
563static ssize_t 566static ssize_t
564sdev_show_timeout (struct device *dev, struct device_attribute *attr, char *buf) 567sdev_show_timeout (struct device *dev, struct device_attribute *attr, char *buf)
565{ 568{
566 struct scsi_device *sdev; 569 struct scsi_device *sdev;
567 sdev = to_scsi_device(dev); 570 sdev = to_scsi_device(dev);
568 return snprintf (buf, 20, "%d\n", sdev->timeout / HZ); 571 return snprintf(buf, 20, "%d\n", sdev->request_queue->rq_timeout / HZ);
569} 572}
570 573
571static ssize_t 574static ssize_t
@@ -576,7 +579,7 @@ sdev_store_timeout (struct device *dev, struct device_attribute *attr,
576 int timeout; 579 int timeout;
577 sdev = to_scsi_device(dev); 580 sdev = to_scsi_device(dev);
578 sscanf (buf, "%d\n", &timeout); 581 sscanf (buf, "%d\n", &timeout);
579 sdev->timeout = timeout * HZ; 582 blk_queue_rq_timeout(sdev->request_queue, timeout * HZ);
580 return count; 583 return count;
581} 584}
582static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout); 585static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout);