aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-01-31 14:36:52 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-02-07 19:02:37 -0500
commit322d739da83bbff0309c202181f79c08d9534880 (patch)
tree4bbe485dc4f942ac6d5c8ad1c4508599a1eb2c66 /drivers/scsi/scsi_transport_iscsi.c
parentc238c3bba9b422a9b453c75e157b416204f22a71 (diff)
[SCSI] iscsi: fix up iscsi printk prefix
Some iscsi class messages have the dev_printk prefix and some libiscsi and iscsi_tcp messages have "iscsi" or the module name as a prefix which is normally pretty useless when trying to figure out which session or connection the message is attached to. This patch adds iscsi lib and class dev_printks so all messages have a common prefix that can be used to figure out which object printed it. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 35834bf4ba86..8e73ff02fb74 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -350,8 +350,9 @@ static void session_recovery_timedout(struct work_struct *work)
350 recovery_work.work); 350 recovery_work.work);
351 unsigned long flags; 351 unsigned long flags;
352 352
353 dev_printk(KERN_INFO, &session->dev, "iscsi: session recovery timed " 353 iscsi_cls_session_printk(KERN_INFO, session,
354 "out after %d secs\n", session->recovery_tmo); 354 "session recovery timed out after %d secs\n",
355 session->recovery_tmo);
355 356
356 spin_lock_irqsave(&session->lock, flags); 357 spin_lock_irqsave(&session->lock, flags);
357 switch (session->state) { 358 switch (session->state) {
@@ -492,8 +493,8 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
492 session->sid); 493 session->sid);
493 err = device_add(&session->dev); 494 err = device_add(&session->dev);
494 if (err) { 495 if (err) {
495 dev_printk(KERN_ERR, &session->dev, "iscsi: could not " 496 iscsi_cls_session_printk(KERN_ERR, session,
496 "register session's dev\n"); 497 "could not register session's dev\n");
497 goto release_host; 498 goto release_host;
498 } 499 }
499 transport_register_device(&session->dev); 500 transport_register_device(&session->dev);
@@ -597,8 +598,9 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
597 err = device_for_each_child(&session->dev, NULL, 598 err = device_for_each_child(&session->dev, NULL,
598 iscsi_iter_destroy_conn_fn); 599 iscsi_iter_destroy_conn_fn);
599 if (err) 600 if (err)
600 dev_printk(KERN_ERR, &session->dev, "iscsi: Could not delete " 601 iscsi_cls_session_printk(KERN_ERR, session,
601 "all connections for session. Error %d.\n", err); 602 "Could not delete all connections "
603 "for session. Error %d.\n", err);
602 604
603 transport_unregister_device(&session->dev); 605 transport_unregister_device(&session->dev);
604 device_del(&session->dev); 606 device_del(&session->dev);
@@ -670,8 +672,8 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid)
670 conn->dev.release = iscsi_conn_release; 672 conn->dev.release = iscsi_conn_release;
671 err = device_register(&conn->dev); 673 err = device_register(&conn->dev);
672 if (err) { 674 if (err) {
673 dev_printk(KERN_ERR, &conn->dev, "iscsi: could not register " 675 iscsi_cls_session_printk(KERN_ERR, session, "could not "
674 "connection's dev\n"); 676 "register connection's dev\n");
675 goto release_parent_ref; 677 goto release_parent_ref;
676 } 678 }
677 transport_register_device(&conn->dev); 679 transport_register_device(&conn->dev);
@@ -778,8 +780,8 @@ int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
778 skb = alloc_skb(len, GFP_ATOMIC); 780 skb = alloc_skb(len, GFP_ATOMIC);
779 if (!skb) { 781 if (!skb) {
780 iscsi_conn_error(conn, ISCSI_ERR_CONN_FAILED); 782 iscsi_conn_error(conn, ISCSI_ERR_CONN_FAILED);
781 dev_printk(KERN_ERR, &conn->dev, "iscsi: can not deliver " 783 iscsi_cls_conn_printk(KERN_ERR, conn, "can not deliver "
782 "control PDU: OOM\n"); 784 "control PDU: OOM\n");
783 return -ENOMEM; 785 return -ENOMEM;
784 } 786 }
785 787
@@ -819,8 +821,8 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
819 821
820 skb = alloc_skb(len, GFP_ATOMIC); 822 skb = alloc_skb(len, GFP_ATOMIC);
821 if (!skb) { 823 if (!skb) {
822 dev_printk(KERN_ERR, &conn->dev, "iscsi: gracefully ignored " 824 iscsi_cls_conn_printk(KERN_ERR, conn, "gracefully ignored "
823 "conn error (%d)\n", error); 825 "conn error (%d)\n", error);
824 return; 826 return;
825 } 827 }
826 828
@@ -834,8 +836,8 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
834 836
835 iscsi_broadcast_skb(skb, GFP_ATOMIC); 837 iscsi_broadcast_skb(skb, GFP_ATOMIC);
836 838
837 dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n", 839 iscsi_cls_conn_printk(KERN_INFO, conn, "detected conn error (%d)\n",
838 error); 840 error);
839} 841}
840EXPORT_SYMBOL_GPL(iscsi_conn_error); 842EXPORT_SYMBOL_GPL(iscsi_conn_error);
841 843
@@ -890,8 +892,8 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
890 892
891 skbstat = alloc_skb(len, GFP_ATOMIC); 893 skbstat = alloc_skb(len, GFP_ATOMIC);
892 if (!skbstat) { 894 if (!skbstat) {
893 dev_printk(KERN_ERR, &conn->dev, "iscsi: can not " 895 iscsi_cls_conn_printk(KERN_ERR, conn, "can not "
894 "deliver stats: OOM\n"); 896 "deliver stats: OOM\n");
895 return -ENOMEM; 897 return -ENOMEM;
896 } 898 }
897 899
@@ -947,8 +949,9 @@ int iscsi_session_event(struct iscsi_cls_session *session,
947 949
948 skb = alloc_skb(len, GFP_KERNEL); 950 skb = alloc_skb(len, GFP_KERNEL);
949 if (!skb) { 951 if (!skb) {
950 dev_printk(KERN_ERR, &session->dev, "Cannot notify userspace " 952 iscsi_cls_session_printk(KERN_ERR, session,
951 "of session event %u\n", event); 953 "Cannot notify userspace of session "
954 "event %u\n", event);
952 return -ENOMEM; 955 return -ENOMEM;
953 } 956 }
954 957
@@ -971,8 +974,8 @@ int iscsi_session_event(struct iscsi_cls_session *session,
971 ev->r.unbind_session.sid = session->sid; 974 ev->r.unbind_session.sid = session->sid;
972 break; 975 break;
973 default: 976 default:
974 dev_printk(KERN_ERR, &session->dev, "Invalid event %u.\n", 977 iscsi_cls_session_printk(KERN_ERR, session, "Invalid event "
975 event); 978 "%u.\n", event);
976 kfree_skb(skb); 979 kfree_skb(skb);
977 return -EINVAL; 980 return -EINVAL;
978 } 981 }
@@ -983,8 +986,10 @@ int iscsi_session_event(struct iscsi_cls_session *session,
983 */ 986 */
984 rc = iscsi_broadcast_skb(skb, GFP_KERNEL); 987 rc = iscsi_broadcast_skb(skb, GFP_KERNEL);
985 if (rc < 0) 988 if (rc < 0)
986 dev_printk(KERN_ERR, &session->dev, "Cannot notify userspace " 989 iscsi_cls_session_printk(KERN_ERR, session,
987 "of session event %u. Check iscsi daemon\n", event); 990 "Cannot notify userspace of session "
991 "event %u. Check iscsi daemon\n",
992 event);
988 return rc; 993 return rc;
989} 994}
990EXPORT_SYMBOL_GPL(iscsi_session_event); 995EXPORT_SYMBOL_GPL(iscsi_session_event);
@@ -1017,16 +1022,15 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev)
1017 1022
1018 session = iscsi_session_lookup(ev->u.c_conn.sid); 1023 session = iscsi_session_lookup(ev->u.c_conn.sid);
1019 if (!session) { 1024 if (!session) {
1020 printk(KERN_ERR "iscsi: invalid session %d\n", 1025 printk(KERN_ERR "iscsi: invalid session %d.\n",
1021 ev->u.c_conn.sid); 1026 ev->u.c_conn.sid);
1022 return -EINVAL; 1027 return -EINVAL;
1023 } 1028 }
1024 1029
1025 conn = transport->create_conn(session, ev->u.c_conn.cid); 1030 conn = transport->create_conn(session, ev->u.c_conn.cid);
1026 if (!conn) { 1031 if (!conn) {
1027 printk(KERN_ERR "iscsi: couldn't create a new " 1032 iscsi_cls_session_printk(KERN_ERR, session,
1028 "connection for session %d\n", 1033 "couldn't create a new connection.");
1029 session->sid);
1030 return -ENOMEM; 1034 return -ENOMEM;
1031 } 1035 }
1032 1036