Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136316
b: refs/heads/master
c: 06d25af
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Mar 13, 2009
1 parent 505f60a commit 703c28b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e28f3d5b51ed07d822f135cd941b01e2d485270e
refs/heads/master: 06d25af4edb60f9e9c7e74d342a6963a32e3392f
38 changes: 6 additions & 32 deletions trunk/drivers/scsi/scsi_transport_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,30 +246,13 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
memset(ihost, 0, sizeof(*ihost));
atomic_set(&ihost->nr_scans, 0);
mutex_init(&ihost->mutex);

snprintf(ihost->scan_workq_name, sizeof(ihost->scan_workq_name),
"iscsi_scan_%d", shost->host_no);
ihost->scan_workq = create_singlethread_workqueue(
ihost->scan_workq_name);
if (!ihost->scan_workq)
return -ENOMEM;
return 0;
}

static int iscsi_remove_host(struct transport_container *tc, struct device *dev,
struct device *cdev)
{
struct Scsi_Host *shost = dev_to_shost(dev);
struct iscsi_cls_host *ihost = shost->shost_data;

destroy_workqueue(ihost->scan_workq);
return 0;
}

static DECLARE_TRANSPORT_CLASS(iscsi_host_class,
"iscsi_host",
iscsi_setup_host,
iscsi_remove_host,
NULL,
NULL);

static DECLARE_TRANSPORT_CLASS(iscsi_session_class,
Expand Down Expand Up @@ -568,7 +551,7 @@ static void __iscsi_unblock_session(struct work_struct *work)
* scanning from userspace).
*/
if (shost->hostt->scan_finished) {
if (queue_work(ihost->scan_workq, &session->scan_work))
if (scsi_queue_work(shost, &session->scan_work))
atomic_inc(&ihost->nr_scans);
}
}
Expand Down Expand Up @@ -636,14 +619,6 @@ static void __iscsi_unbind_session(struct work_struct *work)
iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION);
}

static int iscsi_unbind_session(struct iscsi_cls_session *session)
{
struct Scsi_Host *shost = iscsi_session_to_shost(session);
struct iscsi_cls_host *ihost = shost->shost_data;

return queue_work(ihost->scan_workq, &session->unbind_work);
}

struct iscsi_cls_session *
iscsi_alloc_session(struct Scsi_Host *shost, struct iscsi_transport *transport,
int dd_size)
Expand Down Expand Up @@ -796,7 +771,6 @@ static int iscsi_iter_destroy_conn_fn(struct device *dev, void *data)
void iscsi_remove_session(struct iscsi_cls_session *session)
{
struct Scsi_Host *shost = iscsi_session_to_shost(session);
struct iscsi_cls_host *ihost = shost->shost_data;
unsigned long flags;
int err;

Expand All @@ -821,7 +795,7 @@ void iscsi_remove_session(struct iscsi_cls_session *session)

scsi_target_unblock(&session->dev);
/* flush running scans then delete devices */
flush_workqueue(ihost->scan_workq);
scsi_flush_work(shost);
__iscsi_unbind_session(&session->unbind_work);

/* hw iscsi may not have removed all connections from session */
Expand Down Expand Up @@ -1447,7 +1421,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
case ISCSI_UEVENT_UNBIND_SESSION:
session = iscsi_session_lookup(ev->u.d_session.sid);
if (session)
iscsi_unbind_session(session);
scsi_queue_work(iscsi_session_to_shost(session),
&session->unbind_work);
else
err = -EINVAL;
break;
Expand Down Expand Up @@ -1809,8 +1784,7 @@ iscsi_register_transport(struct iscsi_transport *tt)
priv->daemon_pid = -1;
priv->iscsi_transport = tt;
priv->t.user_scan = iscsi_user_scan;
if (!(tt->caps & CAP_DATA_PATH_OFFLOAD))
priv->t.create_work_queue = 1;
priv->t.create_work_queue = 1;

priv->dev.class = &iscsi_transport_class;
dev_set_name(&priv->dev, "%s", tt->name);
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/scsi/scsi_transport_iscsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ struct iscsi_cls_session {
struct iscsi_cls_host {
atomic_t nr_scans;
struct mutex mutex;
struct workqueue_struct *scan_workq;
char scan_workq_name[20];
};

extern void iscsi_host_for_each_session(struct Scsi_Host *shost,
Expand Down

0 comments on commit 703c28b

Please sign in to comment.