diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-05-22 17:17:50 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-22 17:22:54 -0400 |
commit | ae03bf639a5027d27270123f5f6e3ee6a412781d (patch) | |
tree | d705f41a188ad656b1f47f7952626a9f992e3b8f /block/blk-sysfs.c | |
parent | e1defc4ff0cf57aca6c5e3ff99fa503f5943c1f1 (diff) |
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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 13d38b7e4d0f..142a4acddd43 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 | ||
96 | static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) | 96 | static 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 | |||
109 | queue_max_sectors_store(struct request_queue *q, const char *page, size_t count) | 109 | queue_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 | ||
126 | static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page) | 126 | static 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 | } |