diff options
-rw-r--r-- | block/ll_rw_blk.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 36d205128f9a..527bd8d4db50 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -4072,7 +4072,23 @@ static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page) | |||
4072 | return queue_var_show(max_hw_sectors_kb, (page)); | 4072 | return queue_var_show(max_hw_sectors_kb, (page)); |
4073 | } | 4073 | } |
4074 | 4074 | ||
4075 | static ssize_t queue_max_segments_show(struct request_queue *q, char *page) | ||
4076 | { | ||
4077 | return queue_var_show(q->max_phys_segments, page); | ||
4078 | } | ||
4079 | |||
4080 | static ssize_t queue_max_segments_store(struct request_queue *q, | ||
4081 | const char *page, size_t count) | ||
4082 | { | ||
4083 | unsigned long segments; | ||
4084 | ssize_t ret = queue_var_store(&segments, page, count); | ||
4075 | 4085 | ||
4086 | spin_lock_irq(q->queue_lock); | ||
4087 | q->max_phys_segments = segments; | ||
4088 | spin_unlock_irq(q->queue_lock); | ||
4089 | |||
4090 | return ret; | ||
4091 | } | ||
4076 | static struct queue_sysfs_entry queue_requests_entry = { | 4092 | static struct queue_sysfs_entry queue_requests_entry = { |
4077 | .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, | 4093 | .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, |
4078 | .show = queue_requests_show, | 4094 | .show = queue_requests_show, |
@@ -4096,6 +4112,12 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = { | |||
4096 | .show = queue_max_hw_sectors_show, | 4112 | .show = queue_max_hw_sectors_show, |
4097 | }; | 4113 | }; |
4098 | 4114 | ||
4115 | static struct queue_sysfs_entry queue_max_segments_entry = { | ||
4116 | .attr = {.name = "max_segments", .mode = S_IRUGO | S_IWUSR }, | ||
4117 | .show = queue_max_segments_show, | ||
4118 | .store = queue_max_segments_store, | ||
4119 | }; | ||
4120 | |||
4099 | static struct queue_sysfs_entry queue_iosched_entry = { | 4121 | static struct queue_sysfs_entry queue_iosched_entry = { |
4100 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, | 4122 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, |
4101 | .show = elv_iosched_show, | 4123 | .show = elv_iosched_show, |
@@ -4107,6 +4129,7 @@ static struct attribute *default_attrs[] = { | |||
4107 | &queue_ra_entry.attr, | 4129 | &queue_ra_entry.attr, |
4108 | &queue_max_hw_sectors_entry.attr, | 4130 | &queue_max_hw_sectors_entry.attr, |
4109 | &queue_max_sectors_entry.attr, | 4131 | &queue_max_sectors_entry.attr, |
4132 | &queue_max_segments_entry.attr, | ||
4110 | &queue_iosched_entry.attr, | 4133 | &queue_iosched_entry.attr, |
4111 | NULL, | 4134 | NULL, |
4112 | }; | 4135 | }; |