aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-05-10 07:29:51 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-16 05:08:53 -0400
commit563063a808de6b2004d5b8a09ddcb6125481f4b2 (patch)
tree03fe81595247cf8c8e6fa7cd3753be6c0229cb32 /block
parent70eb8040dc81212c884a464b75e37dca8014f3ad (diff)
ll_rw_blk: temporarily enable max_segments tweaking
Expose this setting for now, so that users can play with enabling large commands without defaulting it to on globally. This is a debug patch, it will be dropped for the final versions. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/ll_rw_blk.c23
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
4075static 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
4080static 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}
4076static struct queue_sysfs_entry queue_requests_entry = { 4092static 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
4115static 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
4099static struct queue_sysfs_entry queue_iosched_entry = { 4121static 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};