linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vikas.chaudhary@qlogic.com
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
	lalit.chandivade@qlogic.com, ravi.anand@qlogic.com,
	Manish Rangankar <manish.rangankar@qlogic.com>
Subject: [PATCH 4/5] scsi_transport_iscsi: export iscsi class session's target_id in sysfs.
Date: Fri, 23 Nov 2012 06:58:41 -0500	[thread overview]
Message-ID: <1353671922-19090-5-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1353671922-19090-1-git-send-email-vikas.chaudhary@qlogic.com>

From: Manish Rangankar <manish.rangankar@qlogic.com>

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
 drivers/scsi/scsi_transport_iscsi.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 31969f2..dac7f8d 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -2503,6 +2503,15 @@ show_priv_session_creator(struct device *dev, struct device_attribute *attr,
 }
 static ISCSI_CLASS_ATTR(priv_sess, creator, S_IRUGO, show_priv_session_creator,
 			NULL);
+static ssize_t
+show_priv_session_target_id(struct device *dev, struct device_attribute *attr,
+			    char *buf)
+{
+	struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent);
+	return sprintf(buf, "%d\n", session->target_id);
+}
+static ISCSI_CLASS_ATTR(priv_sess, target_id, S_IRUGO,
+			show_priv_session_target_id, NULL);
 
 #define iscsi_priv_session_attr_show(field, format)			\
 static ssize_t								\
@@ -2575,6 +2584,7 @@ static struct attribute *iscsi_session_attrs[] = {
 	&dev_attr_priv_sess_creator.attr,
 	&dev_attr_sess_chap_out_idx.attr,
 	&dev_attr_sess_chap_in_idx.attr,
+	&dev_attr_priv_sess_target_id.attr,
 	NULL,
 };
 
@@ -2638,6 +2648,8 @@ static umode_t iscsi_session_attr_is_visible(struct kobject *kobj,
 		return S_IRUGO;
 	else if (attr == &dev_attr_priv_sess_creator.attr)
 		return S_IRUGO;
+	else if (attr == &dev_attr_priv_sess_target_id.attr)
+		return S_IRUGO;
 	else {
 		WARN_ONCE(1, "Invalid session attr");
 		return 0;
-- 
1.7.8.GIT


  parent reply	other threads:[~2012-11-23 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 11:58 [PATCH 0/5] qla4xxx: Updates for scsi "misc" branch vikas.chaudhary
2012-11-23 11:58 ` [PATCH 1/5] qla4xxx: Fix MBOX intr switching from polling to intr mode for ISP83XX vikas.chaudhary
2012-11-23 11:58 ` [PATCH 2/5] qla4xxx: Allow reset in link down case vikas.chaudhary
2012-11-23 11:58 ` [PATCH 3/5] qla4xxx: Fix memory corruption issue in qla4xxx_get_ep_fwdb vikas.chaudhary
2012-11-23 11:58 ` vikas.chaudhary [this message]
2012-11-23 11:58 ` [PATCH 5/5] qla4xxx: Update driver version to 5.03.00-k2 vikas.chaudhary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353671922-19090-5-git-send-email-vikas.chaudhary@qlogic.com \
    --to=vikas.chaudhary@qlogic.com \
    --cc=jbottomley@parallels.com \
    --cc=lalit.chandivade@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manish.rangankar@qlogic.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=ravi.anand@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).