block: make get_request[_wait]() fail if queue is dead
authorTejun Heo <tj@kernel.org>
Wed, 19 Oct 2011 12:33:05 +0000 (14:33 +0200)
committer黄涛 <huangtao@rock-chips.com>
Mon, 18 Mar 2013 09:01:00 +0000 (17:01 +0800)
commit6bf3b250532c96ed8c8c45947479bfd050bb2ff5
treec255ff85d1bbb86f30da33b98484a382043959a8
parent4a8913795aad08b8a2b3e770f2683f83c0697465
block: make get_request[_wait]() fail if queue is dead

Currently get_request[_wait]() allocates request whether queue is dead
or not.  This patch makes get_request[_wait]() return NULL if @q is
dead.  blk_queue_bio() is updated to fail the submitted bio if request
allocation fails.  While at it, add docbook comments for
get_request[_wait]().

Note that the current code has rather unclear (there are spurious DEAD
tests scattered around) assumption that the owner of a queue
guarantees that no request travels block layer if the queue is dead
and this patch in itself doesn't change much; however, this will allow
fixing the broken assumption in the next patch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c