aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin K. Petersen2009-05-22 16:17:50 -0500
committerJens Axboe2009-05-22 16:22:54 -0500
commitae03bf639a5027d27270123f5f6e3ee6a412781d (patch)
treed705f41a188ad656b1f47f7952626a9f992e3b8f /block/blk-sysfs.c
parente1defc4ff0cf57aca6c5e3ff99fa503f5943c1f1 (diff)
downloadkernel-common-ae03bf639a5027d27270123f5f6e3ee6a412781d.tar.gz
kernel-common-ae03bf639a5027d27270123f5f6e3ee6a412781d.tar.xz
kernel-common-ae03bf639a5027d27270123f5f6e3ee6a412781d.zip
block: Use accessor functions for queue limits
Convert all external users of queue limits to using wrapper functions instead of poking the request queue variables directly. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 13d38b7e4d0..142a4acddd4 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -95,7 +95,7 @@ queue_ra_store(struct request_queue *q, const char *page, size_t count)
95 95
96static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) 96static ssize_t queue_max_sectors_show(struct request_queue *q, char *page)
97{ 97{
98 int max_sectors_kb = q->max_sectors >> 1; 98 int max_sectors_kb = queue_max_sectors(q) >> 1;
99 99
100 return queue_var_show(max_sectors_kb, (page)); 100 return queue_var_show(max_sectors_kb, (page));
101} 101}
@@ -109,7 +109,7 @@ static ssize_t
109queue_max_sectors_store(struct request_queue *q, const char *page, size_t count) 109queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
110{ 110{
111 unsigned long max_sectors_kb, 111 unsigned long max_sectors_kb,
112 max_hw_sectors_kb = q->max_hw_sectors >> 1, 112 max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1,
113 page_kb = 1 << (PAGE_CACHE_SHIFT - 10); 113 page_kb = 1 << (PAGE_CACHE_SHIFT - 10);
114 ssize_t ret = queue_var_store(&max_sectors_kb, page, count); 114 ssize_t ret = queue_var_store(&max_sectors_kb, page, count);
115 115
@@ -117,7 +117,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
117 return -EINVAL; 117 return -EINVAL;
118 118
119 spin_lock_irq(q->queue_lock); 119 spin_lock_irq(q->queue_lock);
120 q->max_sectors = max_sectors_kb << 1; 120 blk_queue_max_sectors(q, max_sectors_kb << 1);
121 spin_unlock_irq(q->queue_lock); 121 spin_unlock_irq(q->queue_lock);
122 122
123 return ret; 123 return ret;
@@ -125,7 +125,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
125 125
126static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page) 126static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
127{ 127{
128 int max_hw_sectors_kb = q->max_hw_sectors >> 1; 128 int max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1;
129 129
130 return queue_var_show(max_hw_sectors_kb, (page)); 130 return queue_var_show(max_hw_sectors_kb, (page));
131} 131}