Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/iscsi/dist/src/lib - remove unnecessary and con...
details: https://anonhg.NetBSD.org/src/rev/b94fcde8240f
branches: trunk
changeset: 750974:b94fcde8240f
user: yamt <yamt%NetBSD.org@localhost>
date: Wed Jan 20 11:50:28 2010 +0000
description:
- remove unnecessary and confusing initialization of sess->d.
- add an assertion.
diffstat:
external/bsd/iscsi/dist/src/lib/target.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 749ad40b38ed -r b94fcde8240f external/bsd/iscsi/dist/src/lib/target.c
--- a/external/bsd/iscsi/dist/src/lib/target.c Wed Jan 20 11:45:54 2010 +0000
+++ b/external/bsd/iscsi/dist/src/lib/target.c Wed Jan 20 11:50:28 2010 +0000
@@ -43,6 +43,7 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <assert.h>
#include <stdlib.h>
#ifdef HAVE_NETINET_TCP_H
@@ -1545,6 +1546,7 @@
ISCSI_LOCK(&g_session_q_mutex, return -1);
(void) memset(sess, 0x0, sizeof(*sess));
+ sess->d = -1;
if (iscsi_queue_insert(&g_session_q, sess) != 0) {
iscsi_err(__FILE__, __LINE__,
"iscsi_queue_insert() failed\n");
@@ -1988,6 +1990,7 @@
tgt->main_pid = getpid();
for (i = 0; i < maxsessions; i++) {
g_session[i].id = i;
+ g_session[i].d = -1;
if (iscsi_queue_insert(&g_session_q, &g_session[i]) != 0) {
iscsi_err(__FILE__, __LINE__,
"iscsi_queue_insert() failed\n");
@@ -1995,8 +1998,9 @@
}
}
for (j = 0 ; j < lunv->c ; j++) {
- g_session[j].d = device_init(tgt, lunv, &lunv->v[j]);
- if (g_session[j].d < 0) {
+ int d = device_init(tgt, lunv, &lunv->v[j]);
+
+ if (d < 0) {
iscsi_err(__FILE__, __LINE__,
"device_init() failed\n");
return -1;
@@ -2131,6 +2135,7 @@
goto done;
}
ISCSI_UNLOCK(&g_session_q_mutex, return -1);
+ assert(sess->d == -1);
#if 0
(void) memset(sess, 0x0, sizeof(*sess));
#endif
Home |
Main Index |
Thread Index |
Old Index