diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-05-04 15:27:05 (GMT) |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-05-04 15:29:05 (GMT) |
commit | 5306293c9cd2caf41849cc909281bda628bb989e (patch) | |
tree | 3be4e8231e2772c8a43ddbef5c6a72c20b3054bb /block/blk-sysfs.c | |
parent | dbd65a7e44fff4741a0b2c84bd6bace85d22c242 (diff) | |
parent | 66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8 (diff) | |
download | linux-fsl-qoriq-5306293c9cd2caf41849cc909281bda628bb989e.tar.xz |
Merge commit 'v2.6.34-rc6'
Conflicts:
fs/nfsd/nfs4callback.c
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 2ae2cb3..306759b 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -2,6 +2,7 @@ * Functions related to sysfs handling */ #include <linux/kernel.h> +#include <linux/slab.h> #include <linux/module.h> #include <linux/bio.h> #include <linux/blkdev.h> @@ -106,6 +107,19 @@ static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) return queue_var_show(max_sectors_kb, (page)); } +static ssize_t queue_max_segments_show(struct request_queue *q, char *page) +{ + return queue_var_show(queue_max_segments(q), (page)); +} + +static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page) +{ + if (test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags)) + return queue_var_show(queue_max_segment_size(q), (page)); + + return queue_var_show(PAGE_CACHE_SIZE, (page)); +} + static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page) { return queue_var_show(queue_logical_block_size(q), page); @@ -280,6 +294,16 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = { .show = queue_max_hw_sectors_show, }; +static struct queue_sysfs_entry queue_max_segments_entry = { + .attr = {.name = "max_segments", .mode = S_IRUGO }, + .show = queue_max_segments_show, +}; + +static struct queue_sysfs_entry queue_max_segment_size_entry = { + .attr = {.name = "max_segment_size", .mode = S_IRUGO }, + .show = queue_max_segment_size_show, +}; + static struct queue_sysfs_entry queue_iosched_entry = { .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, .show = elv_iosched_show, @@ -355,6 +379,8 @@ static struct attribute *default_attrs[] = { &queue_ra_entry.attr, &queue_max_hw_sectors_entry.attr, &queue_max_sectors_entry.attr, + &queue_max_segments_entry.attr, + &queue_max_segment_size_entry.attr, &queue_iosched_entry.attr, &queue_hw_sector_size_entry.attr, &queue_logical_block_size_entry.attr, |