diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2014-05-10 11:28:03 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2014-05-10 11:28:03 +0000 |
commit | a5f8ef5ddfa0fef50fab745c76fd6166a531a6b0 (patch) | |
tree | f5845df69329fc3dda351bb194dab78263e188ef /usr.sbin/iscsid | |
parent | b12870a5d75b3e82406ba541feec0aeaf9f19a2e (diff) |
Move the task cleanup from the task fail callback to taskq_cleanup.
This makes the one failure callback a lot simpler.
Diffstat (limited to 'usr.sbin/iscsid')
-rw-r--r-- | usr.sbin/iscsid/task.c | 8 | ||||
-rw-r--r-- | usr.sbin/iscsid/vscsi.c | 9 |
2 files changed, 6 insertions, 11 deletions
diff --git a/usr.sbin/iscsid/task.c b/usr.sbin/iscsid/task.c index 221cabd5ff1..4c12e21f222 100644 --- a/usr.sbin/iscsid/task.c +++ b/usr.sbin/iscsid/task.c @@ -1,4 +1,4 @@ -/* $OpenBSD: task.c,v 1.9 2011/04/28 18:32:01 claudio Exp $ */ +/* $OpenBSD: task.c,v 1.10 2014/05/10 11:28:02 claudio Exp $ */ /* * Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org> @@ -65,10 +65,8 @@ taskq_cleanup(struct taskq *tq) TAILQ_REMOVE(tq, t, entry); if (t->failback) t->failback(t->callarg); - else { - conn_task_cleanup(NULL, t); - free(t); - } + conn_task_cleanup(NULL, t); + free(t); } } diff --git a/usr.sbin/iscsid/vscsi.c b/usr.sbin/iscsid/vscsi.c index 7878aa801d2..f42985869a5 100644 --- a/usr.sbin/iscsid/vscsi.c +++ b/usr.sbin/iscsid/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.13 2014/04/21 18:59:05 claudio Exp $ */ +/* $OpenBSD: vscsi.c,v 1.14 2014/05/10 11:28:02 claudio Exp $ */ /* * Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org> @@ -288,12 +288,9 @@ void vscsi_fail(void *arg) { struct scsi_task *t = arg; - int tag; - conn_task_cleanup(NULL, &t->task); - tag = t->tag; - free(t); - vscsi_status(tag, VSCSI_STAT_RESET, NULL, 0); + log_debug("vscsi_fail: task failed, reseting it"); + vscsi_status(t->tag, VSCSI_STAT_RESET, NULL, 0); } void |