diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-07-09 08:52:32 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.(none)> | 2009-07-10 14:31:53 -0400 |
commit | 8aa7e847d834ed937a9ad37a0f2ad5b8584c1ab0 (patch) | |
tree | 76c8b4f1362a928d426f2201790ab5d128f57724 /mm/backing-dev.c | |
parent | c2cc49a2f8a479dde96a599646d30b6cc9dbed78 (diff) |
Fix congestion_wait() sync/async vs read/write confusion
Commit 1faa16d22877f4839bd433547d770c676d1d964c accidentally broke
the bdi congestion wait queue logic, causing us to wait on congestion
for WRITE (== 1) when we really wanted BLK_RW_ASYNC (== 0) instead.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 493b468a5035..c86edd244294 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -283,7 +283,6 @@ static wait_queue_head_t congestion_wqh[2] = { | |||
283 | __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) | 283 | __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) |
284 | }; | 284 | }; |
285 | 285 | ||
286 | |||
287 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync) | 286 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync) |
288 | { | 287 | { |
289 | enum bdi_state bit; | 288 | enum bdi_state bit; |
@@ -308,18 +307,18 @@ EXPORT_SYMBOL(set_bdi_congested); | |||
308 | 307 | ||
309 | /** | 308 | /** |
310 | * congestion_wait - wait for a backing_dev to become uncongested | 309 | * congestion_wait - wait for a backing_dev to become uncongested |
311 | * @rw: READ or WRITE | 310 | * @sync: SYNC or ASYNC IO |
312 | * @timeout: timeout in jiffies | 311 | * @timeout: timeout in jiffies |
313 | * | 312 | * |
314 | * Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit | 313 | * Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit |
315 | * write congestion. If no backing_devs are congested then just wait for the | 314 | * write congestion. If no backing_devs are congested then just wait for the |
316 | * next write to be completed. | 315 | * next write to be completed. |
317 | */ | 316 | */ |
318 | long congestion_wait(int rw, long timeout) | 317 | long congestion_wait(int sync, long timeout) |
319 | { | 318 | { |
320 | long ret; | 319 | long ret; |
321 | DEFINE_WAIT(wait); | 320 | DEFINE_WAIT(wait); |
322 | wait_queue_head_t *wqh = &congestion_wqh[rw]; | 321 | wait_queue_head_t *wqh = &congestion_wqh[sync]; |
323 | 322 | ||
324 | prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); | 323 | prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); |
325 | ret = io_schedule_timeout(timeout); | 324 | ret = io_schedule_timeout(timeout); |