]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5e27a78470e06d0c5b987504c338cedc74a8a753
tree710a5799da6c38843560b412b7918b7d3c63bf29
parent00567b97e06d31bf8deee071cabda819a9f1e52c
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