block: factor out a blk_try_enter_queue helper

Factor out the code to try to get q_usage_counter without blocking into
a separate helper.  Both to improve code readability and to prepare for
splitting bio_queue_enter from blk_queue_enter.

Signed-off-by: Christoph Hellwig <>
Tested-by: Darrick J. Wong <>
Tested-by: Yi Zhang <>
Signed-off-by: Jens Axboe <>
1 file changed