linux/include/target
Joern Engel 33940d0993 target: encapsulate smp_mb__after_atomic()
The target code has a rather generous helping of smp_mb__after_atomic()
throughout the code base.  Most atomic operations were followed by one
and none were preceded by smp_mb__before_atomic(), nor accompanied by a
comment explaining the need for a barrier.

Instead of trying to prove for every case whether or not it is needed,
this patch introduces atomic_inc_mb() and atomic_dec_mb(), which
explicitly include the memory barriers before and after the atomic
operation.  For now they are defined in a target header, although they
could be of general use.

Most of the existing atomic/mb combinations were replaced by the new
helpers.  In a few cases the atomic was sandwiched in
spin_lock/spin_unlock and I simply removed the barrier.

I suspect that in most cases the correct conversion would have been to
drop the barrier.  I also suspect that a few cases exist where a) the
barrier was necessary and b) a second barrier before the atomic would
have been necessary and got added by this patch.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2014-10-01 14:39:06 -07:00
..
iscsi Target/iscsi: Fix sendtargets response pdu for iser transport 2014-06-11 11:52:39 -07:00
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: Report correct response length for some commands 2014-06-11 12:15:30 -07:00
target_core_base.h target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_configfs.h target: Remove TF_CIT_TMPL macro 2013-10-16 13:35:02 -07:00
target_core_fabric_configfs.h target: Add se_portal_group->tpg_auth_group 2013-07-03 19:44:31 -07:00
target_core_fabric.h target: Pass in transport supported PI at session initialization 2014-04-07 01:48:54 -07:00