aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_tpc.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2017-02-27 14:59:00 +0000
committerAlexander Motin <mav@FreeBSD.org>2017-02-27 14:59:00 +0000
commit9ff948d05f94965066049938c82c87236d796760 (patch)
treeed51921e4e3410c55ba0ccac14e1a56e49bad534 /sys/cam/ctl/ctl_tpc.c
parent3cfeca84b48bc3c658ffb5a5626cba29c8c0f03f (diff)
downloadsrc-9ff948d05f94965066049938c82c87236d796760.tar.gz
src-9ff948d05f94965066049938c82c87236d796760.zip
Polish handling of different reset flavours.
The biggest change is that ctl_remove_initiator() now generates I_T NEXUS LOSS event, cleaning part of LUs state related to the initiator. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=314338
Diffstat (limited to 'sys/cam/ctl/ctl_tpc.c')
-rw-r--r--sys/cam/ctl/ctl_tpc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 39d4f2440af9..36b99a07439f 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -222,6 +222,21 @@ ctl_tpc_lun_init(struct ctl_lun *lun)
}
void
+ctl_tpc_lun_clear(struct ctl_lun *lun, uint32_t initidx)
+{
+ struct tpc_list *list, *tlist;
+
+ TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) {
+ if (initidx != -1 && list->init_idx != initidx)
+ continue;
+ if (!list->completed)
+ continue;
+ TAILQ_REMOVE(&lun->tpc_lists, list, links);
+ free(list, M_CTL);
+ }
+}
+
+void
ctl_tpc_lun_shutdown(struct ctl_lun *lun)
{
struct ctl_softc *softc = lun->ctl_softc;