diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:42:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:42:25 -0500 |
commit | 382f51fe2f2276344d8a21447656778cdf6583b6 (patch) | |
tree | c2836a2cca4126c9c026ce5aa2fdf9f1c8ccded6 /drivers/scsi/scsi_sysfs.c | |
parent | 701791cc3c8fc6dd83f6ec8af7e2541b4a316606 (diff) | |
parent | 54987386ee3790f3900de4df2ed4deb0e18dfc9f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
[SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
[SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
[SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
[SCSI] zfcp: Update FSF error reporting
[SCSI] zfcp: Improve ELS ADISC handling
[SCSI] zfcp: Simplify handling of ct and els requests
[SCSI] zfcp: Remove ZFCP_DID_MASK
[SCSI] zfcp: Move WKA port to zfcp FC code
[SCSI] zfcp: Use common code definitions for FC CT structs
[SCSI] zfcp: Use common code definitions for FC ELS structs
[SCSI] zfcp: Update FCP protocol related code
[SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
[SCSI] zfcp: Assign scheduled work to driver queue
[SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
[SCSI] zfcp: Implement module unloading
[SCSI] zfcp: Merge trace code for fsf requests in one function
[SCSI] zfcp: Access ports and units with container_of in sysfs code
[SCSI] zfcp: Remove suspend callback
[SCSI] zfcp: Remove global config_mutex
[SCSI] zfcp: Replace local reference counting with common kref
...
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 392d8db33905..5a065055e68a 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -766,10 +766,13 @@ sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr, | |||
766 | if (depth < 1) | 766 | if (depth < 1) |
767 | return -EINVAL; | 767 | return -EINVAL; |
768 | 768 | ||
769 | retval = sht->change_queue_depth(sdev, depth); | 769 | retval = sht->change_queue_depth(sdev, depth, |
770 | SCSI_QDEPTH_DEFAULT); | ||
770 | if (retval < 0) | 771 | if (retval < 0) |
771 | return retval; | 772 | return retval; |
772 | 773 | ||
774 | sdev->max_queue_depth = sdev->queue_depth; | ||
775 | |||
773 | return count; | 776 | return count; |
774 | } | 777 | } |
775 | 778 | ||
@@ -778,6 +781,37 @@ static struct device_attribute sdev_attr_queue_depth_rw = | |||
778 | sdev_store_queue_depth_rw); | 781 | sdev_store_queue_depth_rw); |
779 | 782 | ||
780 | static ssize_t | 783 | static ssize_t |
784 | sdev_show_queue_ramp_up_period(struct device *dev, | ||
785 | struct device_attribute *attr, | ||
786 | char *buf) | ||
787 | { | ||
788 | struct scsi_device *sdev; | ||
789 | sdev = to_scsi_device(dev); | ||
790 | return snprintf(buf, 20, "%u\n", | ||
791 | jiffies_to_msecs(sdev->queue_ramp_up_period)); | ||
792 | } | ||
793 | |||
794 | static ssize_t | ||
795 | sdev_store_queue_ramp_up_period(struct device *dev, | ||
796 | struct device_attribute *attr, | ||
797 | const char *buf, size_t count) | ||
798 | { | ||
799 | struct scsi_device *sdev = to_scsi_device(dev); | ||
800 | unsigned long period; | ||
801 | |||
802 | if (strict_strtoul(buf, 10, &period)) | ||
803 | return -EINVAL; | ||
804 | |||
805 | sdev->queue_ramp_up_period = msecs_to_jiffies(period); | ||
806 | return period; | ||
807 | } | ||
808 | |||
809 | static struct device_attribute sdev_attr_queue_ramp_up_period = | ||
810 | __ATTR(queue_ramp_up_period, S_IRUGO | S_IWUSR, | ||
811 | sdev_show_queue_ramp_up_period, | ||
812 | sdev_store_queue_ramp_up_period); | ||
813 | |||
814 | static ssize_t | ||
781 | sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr, | 815 | sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr, |
782 | const char *buf, size_t count) | 816 | const char *buf, size_t count) |
783 | { | 817 | { |
@@ -867,8 +901,12 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) | |||
867 | sdev->is_visible = 1; | 901 | sdev->is_visible = 1; |
868 | 902 | ||
869 | /* create queue files, which may be writable, depending on the host */ | 903 | /* create queue files, which may be writable, depending on the host */ |
870 | if (sdev->host->hostt->change_queue_depth) | 904 | if (sdev->host->hostt->change_queue_depth) { |
871 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw); | 905 | error = device_create_file(&sdev->sdev_gendev, |
906 | &sdev_attr_queue_depth_rw); | ||
907 | error = device_create_file(&sdev->sdev_gendev, | ||
908 | &sdev_attr_queue_ramp_up_period); | ||
909 | } | ||
872 | else | 910 | else |
873 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); | 911 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); |
874 | if (error) | 912 | if (error) |