aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 2ae2cb3f362f..306759bbdf1b 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -2,6 +2,7 @@
2 * Functions related to sysfs handling 2 * Functions related to sysfs handling
3 */ 3 */
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/slab.h>
5#include <linux/module.h> 6#include <linux/module.h>
6#include <linux/bio.h> 7#include <linux/bio.h>
7#include <linux/blkdev.h> 8#include <linux/blkdev.h>
@@ -106,6 +107,19 @@ static ssize_t queue_max_sectors_show(struct request_queue *q, char *page)
106 return queue_var_show(max_sectors_kb, (page)); 107 return queue_var_show(max_sectors_kb, (page));
107} 108}
108 109
110static 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
115static 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
109static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) 123static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page)
110{ 124{
111 return queue_var_show(queue_logical_block_size(q), page); 125 return queue_var_show(queue_logical_block_size(q), page);
@@ -280,6 +294,16 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = {
280 .show = queue_max_hw_sectors_show, 294 .show = queue_max_hw_sectors_show,
281}; 295};
282 296
297static struct queue_sysfs_entry queue_max_segments_entry = {
298 .attr = {.name = "max_segments", .mode = S_IRUGO },
299 .show = queue_max_segments_show,
300};
301
302static 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
283static struct queue_sysfs_entry queue_iosched_entry = { 307static struct queue_sysfs_entry queue_iosched_entry = {
284 .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, 308 .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR },
285 .show = elv_iosched_show, 309 .show = elv_iosched_show,
@@ -355,6 +379,8 @@ static struct attribute *default_attrs[] = {
355 &queue_ra_entry.attr, 379 &queue_ra_entry.attr,
356 &queue_max_hw_sectors_entry.attr, 380 &queue_max_hw_sectors_entry.attr,
357 &queue_max_sectors_entry.attr, 381 &queue_max_sectors_entry.attr,
382 &queue_max_segments_entry.attr,
383 &queue_max_segment_size_entry.attr,
358 &queue_iosched_entry.attr, 384 &queue_iosched_entry.attr,
359 &queue_hw_sector_size_entry.attr, 385 &queue_hw_sector_size_entry.attr,
360 &queue_logical_block_size_entry.attr, 386 &queue_logical_block_size_entry.attr,