Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77060
b: refs/heads/master
c: d8bf541
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Jan 12, 2008
1 parent a2e970c commit f502390
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: b3a7ea8d50f6028964b468d13a095dfb2508b2fb
refs/heads/master: d8bf541e657824cb03effd726ac96e2f4dcf58a5
16 changes: 12 additions & 4 deletions trunk/drivers/scsi/scsi_transport_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct iscsi_internal {
};

static atomic_t iscsi_session_nr; /* sysfs session id for next new session */
static struct workqueue_struct *iscsi_eh_timer_workq;

/*
* list of registered transports and lock that must
Expand Down Expand Up @@ -252,16 +253,16 @@ static void session_recovery_timedout(struct work_struct *work)
void iscsi_unblock_session(struct iscsi_cls_session *session)
{
if (!cancel_delayed_work(&session->recovery_work))
flush_scheduled_work();
flush_workqueue(iscsi_eh_timer_workq);
scsi_target_unblock(&session->dev);
}
EXPORT_SYMBOL_GPL(iscsi_unblock_session);

void iscsi_block_session(struct iscsi_cls_session *session)
{
scsi_target_block(&session->dev);
schedule_delayed_work(&session->recovery_work,
session->recovery_tmo * HZ);
queue_delayed_work(iscsi_eh_timer_workq, &session->recovery_work,
session->recovery_tmo * HZ);
}
EXPORT_SYMBOL_GPL(iscsi_block_session);

Expand Down Expand Up @@ -357,7 +358,7 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
struct iscsi_host *ihost = shost->shost_data;

if (!cancel_delayed_work(&session->recovery_work))
flush_scheduled_work();
flush_workqueue(iscsi_eh_timer_workq);

mutex_lock(&ihost->mutex);
list_del(&session->host_list);
Expand Down Expand Up @@ -1521,8 +1522,14 @@ static __init int iscsi_transport_init(void)
goto unregister_session_class;
}

iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
if (!iscsi_eh_timer_workq)
goto release_nls;

return 0;

release_nls:
sock_release(nls->sk_socket);
unregister_session_class:
transport_class_unregister(&iscsi_session_class);
unregister_conn_class:
Expand All @@ -1536,6 +1543,7 @@ static __init int iscsi_transport_init(void)

static void __exit iscsi_transport_exit(void)
{
destroy_workqueue(iscsi_eh_timer_workq);
sock_release(nls->sk_socket);
transport_class_unregister(&iscsi_connection_class);
transport_class_unregister(&iscsi_session_class);
Expand Down

0 comments on commit f502390

Please sign in to comment.