tcm_qla2xxx: Perform configfs depend/undepend for base_tpg
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 20 Feb 2014 00:53:07 +0000 (16:53 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 20 Feb 2014 21:01:17 +0000 (13:01 -0800)
commit7474f52a82d51da2e6110e91bba8b000cb9cf803
tree7ea5e1f43284aa10debb071398abd4c10178a956
parent394d62ba4580a74afc90bf0e007e10291bf447cc
tcm_qla2xxx: Perform configfs depend/undepend for base_tpg

This patch performs configfs_depend_item() during TPG enable for
base_tpg (eg: non-NPIV) ports, and configfs_undepend_item() during
TPG disable for base_tpg.

This is done to ensure that any attempt to configfs rmdir a base_tpg
with active NPIV ports will fail with -EBUSY, until all associated
NPIV ports have been explicitly shutdown and base_tpg disabled.

Note that the actual configfs_[un]depend_item() is done from seperate
process context, as these are not intended to be called directly
from configfs callbacks.

Cc: Sawan Chandak <sawan.chandak@qlogic.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/scsi/qla2xxx/tcm_qla2xxx.h