From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Hi folks, This is a long overdue conversion to proper refcounting for se_lun association to se_cmd descriptors. This had historically been done using a per se_lun list of active se_cmds, along with a explicit drain of active command during se_lun shutdown. This patch adds modern percpu refcounting at se_lun->lun_ref that allows se_lun shutdown code to be drastically simplified. Instead of draining the per se_lun list of command se_cmd descriptors, simply wait for all outstanding references of se_lun->lun_ref to complete. Along with getting rid of 200 LOC for the se_lun shutdown, it also drops the se_lun->lun_cmd_lock access from transport_lookup_cmd_lun() and transport_lun_remove_cmd(). Thanks! --nab Nicholas Bellinger (3): percpu-refcount: Add EXPORT_SYMBOL to use percpu_ref from modules target: Add percpu refcounting for se_lun access target: Drop left-over se_lun->lun_cmd_list shutdown code drivers/infiniband/ulp/srpt/ib_srpt.c | 10 -- drivers/target/target_core_device.c | 10 +- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 40 ++++-- drivers/target/target_core_transport.c | 237 ++------------------------------ drivers/target/target_core_xcopy.c | 3 +- include/target/target_core_base.h | 18 ++- lib/percpu-refcount.c | 3 + 8 files changed, 54 insertions(+), 269 deletions(-) -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html