diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-04-02 14:55:38 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 14:55:38 -0400 |
commit | 401600dfd368305e641d79db16d514f55c084544 (patch) | |
tree | 4e1c3f19c52d2bb7d78ec01689d17659960732ab /drivers | |
parent | ef2085870ea448b3c19160d899cf4f948da6a384 (diff) |
dm: allow uninterruptible wait for pending io
Allow uninterruptible wait for pending IOs.
Add argument "interruptible" to dm_wait_for_completion that specifies
either interruptible or uninterruptible waiting.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 4ba0811f28c5..ae21833b270a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1375,18 +1375,19 @@ void dm_put(struct mapped_device *md) | |||
1375 | } | 1375 | } |
1376 | EXPORT_SYMBOL_GPL(dm_put); | 1376 | EXPORT_SYMBOL_GPL(dm_put); |
1377 | 1377 | ||
1378 | static int dm_wait_for_completion(struct mapped_device *md) | 1378 | static int dm_wait_for_completion(struct mapped_device *md, int interruptible) |
1379 | { | 1379 | { |
1380 | int r = 0; | 1380 | int r = 0; |
1381 | 1381 | ||
1382 | while (1) { | 1382 | while (1) { |
1383 | set_current_state(TASK_INTERRUPTIBLE); | 1383 | set_current_state(interruptible); |
1384 | 1384 | ||
1385 | smp_mb(); | 1385 | smp_mb(); |
1386 | if (!atomic_read(&md->pending)) | 1386 | if (!atomic_read(&md->pending)) |
1387 | break; | 1387 | break; |
1388 | 1388 | ||
1389 | if (signal_pending(current)) { | 1389 | if (interruptible == TASK_INTERRUPTIBLE && |
1390 | signal_pending(current)) { | ||
1390 | r = -EINTR; | 1391 | r = -EINTR; |
1391 | break; | 1392 | break; |
1392 | } | 1393 | } |
@@ -1565,7 +1566,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags) | |||
1565 | /* | 1566 | /* |
1566 | * Wait for the already-mapped ios to complete. | 1567 | * Wait for the already-mapped ios to complete. |
1567 | */ | 1568 | */ |
1568 | r = dm_wait_for_completion(md); | 1569 | r = dm_wait_for_completion(md, TASK_INTERRUPTIBLE); |
1569 | 1570 | ||
1570 | down_write(&md->io_lock); | 1571 | down_write(&md->io_lock); |
1571 | remove_wait_queue(&md->wait, &wait); | 1572 | remove_wait_queue(&md->wait, &wait); |