scsi: convert target_busy to an atomic_t
authorChristoph Hellwig <hch@lst.de>
Thu, 26 Jun 2014 02:08:50 +0000 (20:08 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:12:27 +0000 (12:12 -0600)
commit4a5801c8038bd8cace089c237ed473ece3be549a
treed81c2f3d93a90ddc201e8ac054a9f3db39945891
parent1286640eddf5b5d2c8c9f142e022b78528377138
scsi: convert target_busy to an atomic_t

Avoid taking the host-wide host_lock to check the per-target queue limit.
Instead we do an atomic_inc_return early on to grab our slot in the queue,
and if nessecary decrement it after finishing all checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_device.h