dm: move wait queue declaration
commitb44ebeb017b8a5fe5439e1259708b68cf83a8921
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 2 Apr 2009 18:55:39 +0000 (2 19:55 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 2 Apr 2009 18:55:39 +0000 (2 19:55 +0100)
treeea138d44aa80302002b3e67cd6049a18c2302734
parent022c261100e15652d720395b17ce76304fb2f97f
dm: move wait queue declaration

Move wait queue declaration and unplug to dm_wait_for_completion.

The purpose is to minimize duplicate code in the further patches.

The patch reorders functions a little bit. It doesn't change any
functionality. For proper non-deadlock operation, add_wait_queue must
happen before set_current_state(interruptible) and before the test for
!atomic_read(&md->pending).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm.c