summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-05-07 06:31:45 +0000
committertrasz <trasz@FreeBSD.org>2014-05-07 06:31:45 +0000
commit26ce3cd6c7993f9ec2fec589b5283460be5d33e6 (patch)
tree367453c7b8f17d76215fd55d989d130772ff65d2 /sys/dev/iscsi
parent76ebd34835b2e2e1d405517d42868a02764eec0d (diff)
downloadFreeBSD-src-26ce3cd6c7993f9ec2fec589b5283460be5d33e6.zip
FreeBSD-src-26ce3cd6c7993f9ec2fec589b5283460be5d33e6.tar.gz
MFC r264023:
Instead of "icltx" and "iclrx", use thread names with prefix from upper layer, so that one can see which side of the stack the threads are for. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c9
-rw-r--r--sys/dev/iscsi/icl.h3
-rw-r--r--sys/dev/iscsi/iscsi.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index 3576b4f..e548fd4 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -971,7 +971,7 @@ icl_pdu_queue(struct icl_pdu *ip)
}
struct icl_conn *
-icl_conn_new(struct mtx *lock)
+icl_conn_new(const char *name, struct mtx *lock)
{
struct icl_conn *ic;
@@ -987,6 +987,7 @@ icl_conn_new(struct mtx *lock)
refcount_init(&ic->ic_outstanding_pdus, 0);
#endif
ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH;
+ ic->ic_name = name;
return (ic);
}
@@ -1062,14 +1063,16 @@ icl_conn_start(struct icl_conn *ic)
/*
* Start threads.
*/
- error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "icltx");
+ error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx",
+ ic->ic_name);
if (error != 0) {
ICL_WARN("kthread_add(9) failed with error %d", error);
icl_conn_close(ic);
return (error);
}
- error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "iclrx");
+ error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx",
+ ic->ic_name);
if (error != 0) {
ICL_WARN("kthread_add(9) failed with error %d", error);
icl_conn_close(ic);
diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h
index 2bfc5dc..e40c0ac 100644
--- a/sys/dev/iscsi/icl.h
+++ b/sys/dev/iscsi/icl.h
@@ -92,6 +92,7 @@ struct icl_conn {
size_t ic_max_data_segment_length;
bool ic_disconnecting;
bool ic_iser;
+ const char *ic_name;
void (*ic_receive)(struct icl_pdu *);
void (*ic_error)(struct icl_conn *);
@@ -102,7 +103,7 @@ struct icl_conn {
void *ic_prv0;
};
-struct icl_conn *icl_conn_new(struct mtx *lock);
+struct icl_conn *icl_conn_new(const char *name, struct mtx *lock);
void icl_conn_free(struct icl_conn *ic);
int icl_conn_handoff(struct icl_conn *ic, int fd);
void icl_conn_shutdown(struct icl_conn *ic);
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index df881ed..f0957c4 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1633,7 +1633,7 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
return (EBUSY);
}
- is->is_conn = icl_conn_new(&is->is_lock);
+ is->is_conn = icl_conn_new("iscsi", &is->is_lock);
is->is_conn->ic_receive = iscsi_receive_callback;
is->is_conn->ic_error = iscsi_error_callback;
is->is_conn->ic_prv0 = is;
OpenPOWER on IntegriCloud