diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2010-03-10 00:48:33 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-03-15 07:48:00 -0400 |
commit | c77a5710b7e23847bfdb81fcaa10b585f65c960a (patch) | |
tree | 52a09887c6396d71545e321f508a511cfb9cdb0f /block | |
parent | ee714f2dd33e726346e34f5cda12543162f4753e (diff) |
block: Export max number of segments and max segment size in sysfs
These two values are useful when debugging issues surrounding maximum
I/O size. Put them in sysfs with the rest of the queue limits.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-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 e85442415db3..fad86550255a 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -106,6 +106,19 @@ static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) | |||
106 | return queue_var_show(max_sectors_kb, (page)); | 106 | return queue_var_show(max_sectors_kb, (page)); |
107 | } | 107 | } |
108 | 108 | ||
109 | static ssize_t queue_max_segments_show(struct request_queue *q, char *page) | ||
110 | { | ||
111 | return queue_var_show(queue_max_segments(q), (page)); | ||
112 | } | ||
113 | |||
114 | static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page) | ||
115 | { | ||
116 | if (test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags)) | ||
117 | return queue_var_show(queue_max_segment_size(q), (page)); | ||
118 | |||
119 | return queue_var_show(PAGE_CACHE_SIZE, (page)); | ||
120 | } | ||
121 | |||
109 | static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) | 122 | static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) |
110 | { | 123 | { |
111 | return queue_var_show(queue_logical_block_size(q), page); | 124 | return queue_var_show(queue_logical_block_size(q), page); |
@@ -280,6 +293,16 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = { | |||
280 | .show = queue_max_hw_sectors_show, | 293 | .show = queue_max_hw_sectors_show, |
281 | }; | 294 | }; |
282 | 295 | ||
296 | static struct queue_sysfs_entry queue_max_segments_entry = { | ||
297 | .attr = {.name = "max_segments", .mode = S_IRUGO }, | ||
298 | .show = queue_max_segments_show, | ||
299 | }; | ||
300 | |||
301 | static struct queue_sysfs_entry queue_max_segment_size_entry = { | ||
302 | .attr = {.name = "max_segment_size", .mode = S_IRUGO }, | ||
303 | .show = queue_max_segment_size_show, | ||
304 | }; | ||
305 | |||
283 | static struct queue_sysfs_entry queue_iosched_entry = { | 306 | static struct queue_sysfs_entry queue_iosched_entry = { |
284 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, | 307 | .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, |
285 | .show = elv_iosched_show, | 308 | .show = elv_iosched_show, |
@@ -355,6 +378,8 @@ static struct attribute *default_attrs[] = { | |||
355 | &queue_ra_entry.attr, | 378 | &queue_ra_entry.attr, |
356 | &queue_max_hw_sectors_entry.attr, | 379 | &queue_max_hw_sectors_entry.attr, |
357 | &queue_max_sectors_entry.attr, | 380 | &queue_max_sectors_entry.attr, |
381 | &queue_max_segments_entry.attr, | ||
382 | &queue_max_segment_size_entry.attr, | ||
358 | &queue_iosched_entry.attr, | 383 | &queue_iosched_entry.attr, |
359 | &queue_hw_sector_size_entry.attr, | 384 | &queue_hw_sector_size_entry.attr, |
360 | &queue_logical_block_size_entry.attr, | 385 | &queue_logical_block_size_entry.attr, |