target: simplify transport_put_cmd
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Sep 2011 21:08:42 +0000 (23:08 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 24 Oct 2011 03:20:34 +0000 (03:20 +0000)
commit4911e3ccbec047ed1f728e19a70ad87729a3fb01
tree710a5799da6c38843560b412b7918b7d3c63bf29
parentd3df7825aed2e69e12732f9e32ef9093b01302d8
target: simplify transport_put_cmd

Inline two simple functions only used by it, and replace a goto
with a simple if else construct.

Note that the code moved from transport_dec_and_check seems fairly
buggy - the atomic_read check on a variable where we'd do an
atomic_dec_and_test looks racy if we'll ever get someone increment
it without the lock held around them (which it looks like we do),
and not decrementing the second counter if the first one doesn't
hit zero also at least needs an explanation.

(nab: Fix transport_put_cmd breakage)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c