aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:54:00 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:16 -0400
commita4804cd6eb19318ae8d08ea967cfeaaf5c5b68a6 (patch)
treea69acbfdf4e3646ebb7583f0627b7b7952d13b10 /drivers/scsi/scsi_transport_iscsi.c
parent756135215ec743be6fdce2bdebe8cdb9f8a231f6 (diff)
[SCSI] iscsi: add iscsi host helpers
This finishes the host/session unbinding, by adding some helpers to add and remove hosts and the session they manage. 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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 9c00a157b485..6fdaa2ee6632 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -279,6 +279,24 @@ static int iscsi_is_session_dev(const struct device *dev)
279 return dev->release == iscsi_session_release; 279 return dev->release == iscsi_session_release;
280} 280}
281 281
282static int iscsi_iter_session_fn(struct device *dev, void *data)
283{
284 void (* fn) (struct iscsi_cls_session *) = data;
285
286 if (!iscsi_is_session_dev(dev))
287 return 0;
288 fn(iscsi_dev_to_session(dev));
289 return 0;
290}
291
292void iscsi_host_for_each_session(struct Scsi_Host *shost,
293 void (*fn)(struct iscsi_cls_session *))
294{
295 device_for_each_child(&shost->shost_gendev, fn,
296 iscsi_iter_session_fn);
297}
298EXPORT_SYMBOL_GPL(iscsi_host_for_each_session);
299
282/** 300/**
283 * iscsi_scan_finished - helper to report when running scans are done 301 * iscsi_scan_finished - helper to report when running scans are done
284 * @shost: scsi host 302 * @shost: scsi host
@@ -1599,6 +1617,8 @@ iscsi_register_transport(struct iscsi_transport *tt)
1599 priv->daemon_pid = -1; 1617 priv->daemon_pid = -1;
1600 priv->iscsi_transport = tt; 1618 priv->iscsi_transport = tt;
1601 priv->t.user_scan = iscsi_user_scan; 1619 priv->t.user_scan = iscsi_user_scan;
1620 if (!(tt->caps & CAP_DATA_PATH_OFFLOAD))
1621 priv->t.create_work_queue = 1;
1602 1622
1603 priv->dev.class = &iscsi_transport_class; 1623 priv->dev.class = &iscsi_transport_class;
1604 snprintf(priv->dev.bus_id, BUS_ID_SIZE, "%s", tt->name); 1624 snprintf(priv->dev.bus_id, BUS_ID_SIZE, "%s", tt->name);