diff options
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index c2b821fa324a..306759bbdf1b 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -107,6 +107,19 @@ static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) | |||
107 | return queue_var_show(max_sectors_kb, (page)); | 107 | return queue_var_show(max_sectors_kb, (page)); |
108 | } | 108 | } |
109 | 109 | ||
110 | static ssize_t queue_max_segments_show(struct request_queue *q, char *page) | ||
111 | { | ||
112 | return queue_var_show(queue_max_segments(q), (page)); | ||
113 | } | ||
114 | |||
115 | static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page) | ||
116 | { | ||
117 | if (test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags)) | ||
118 | return queue_var_show(queue_max_segment_size(q), (page)); | ||
119 | |||
120 | return queue_var_show(PAGE_CACHE_SIZE, (page)); | ||
121 | } | ||
122 | |||
110 | static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) | 123 | static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) |
111 | { | 124 | { |
112 | return queue_var_show(queue_logical_block_size(q), page); | 125 | return queue_var_show(queue_logical_block_size(q), page); |
@@ -281,6 +294,16 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = { | |||
281 | .show = queue_max_hw_sectors_show, | 294 | .show = queue_max_hw_sectors_show, |
282 | }; | 295 | }; |
283 | 296 | ||
297 | static struct queue_sysfs_entry queue_max_segments_entry = { | ||
298 | .attr = {.name = "max_segments", .mode = S_IRUGO }, | ||
299 | .show = queue_max_segments_show, | ||
300 | }; | ||
301 | |||
302 | static struct queue_sysfs_entry queue_max_segment_size_entry = { | ||
303 | .attr = {.name = "max_segment_size", .mode = S_IRUGO }, | ||
304 | .show = queue_max_segment_size_show, | ||
305 | }; | ||
306 | |||
284 | static struct queue_sysfs_entry queue_iosched_entry = { | 307 | static struct queue_sysfs_entry queue_iosched_entry = { |
285 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, | 308 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, |
286 | .show = elv_iosched_show, | 309 | .show = elv_iosched_show, |
@@ -356,6 +379,8 @@ static struct attribute *default_attrs[] = { | |||
356 | &queue_ra_entry.attr, | 379 | &queue_ra_entry.attr, |
357 | &queue_max_hw_sectors_entry.attr, | 380 | &queue_max_hw_sectors_entry.attr, |
358 | &queue_max_sectors_entry.attr, | 381 | &queue_max_sectors_entry.attr, |
382 | &queue_max_segments_entry.attr, | ||
383 | &queue_max_segment_size_entry.attr, | ||
359 | &queue_iosched_entry.attr, | 384 | &queue_iosched_entry.attr, |
360 | &queue_hw_sector_size_entry.attr, | 385 | &queue_hw_sector_size_entry.attr, |
361 | &queue_logical_block_size_entry.attr, | 386 | &queue_logical_block_size_entry.attr, |