};
static atomic_t iscsi_session_nr; /* sysfs session id for next new session */
-static struct workqueue_struct *iscsi_eh_timer_workq;
static struct workqueue_struct *iscsi_conn_cleanup_workq;
if (!cancel_work_sync(&session->block_work))
cancel_delayed_work_sync(&session->recovery_work);
- queue_work(iscsi_eh_timer_workq, &session->unblock_work);
+ queue_work(session->workq, &session->unblock_work);
/*
* Blocking the session can be done from any context so we only
* queue the block work. Make sure the unblock work has completed
scsi_target_block(&session->dev);
ISCSI_DBG_TRANS_SESSION(session, "Completed SCSI target blocking\n");
if (session->recovery_tmo >= 0)
- queue_delayed_work(iscsi_eh_timer_workq,
+ queue_delayed_work(session->workq,
&session->recovery_work,
session->recovery_tmo * HZ);
}
void iscsi_block_session(struct iscsi_cls_session *session)
{
- queue_work(iscsi_eh_timer_workq, &session->block_work);
+ queue_work(session->workq, &session->block_work);
}
EXPORT_SYMBOL_GPL(iscsi_block_session);
goto unregister_flashnode_bus;
}
- iscsi_eh_timer_workq = alloc_workqueue("%s",
- WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
- 1, "iscsi_eh");
- if (!iscsi_eh_timer_workq) {
- err = -ENOMEM;
- goto release_nls;
- }
-
iscsi_conn_cleanup_workq = alloc_workqueue("%s",
WQ_SYSFS | WQ_MEM_RECLAIM | WQ_UNBOUND, 0,
"iscsi_conn_cleanup");
if (!iscsi_conn_cleanup_workq) {
err = -ENOMEM;
- goto destroy_wq;
+ goto release_nls;
}
return 0;
-destroy_wq:
- destroy_workqueue(iscsi_eh_timer_workq);
release_nls:
netlink_kernel_release(nls);
unregister_flashnode_bus:
static void __exit iscsi_transport_exit(void)
{
destroy_workqueue(iscsi_conn_cleanup_workq);
- destroy_workqueue(iscsi_eh_timer_workq);
netlink_kernel_release(nls);
bus_unregister(&iscsi_flashnode_bus);
transport_class_unregister(&iscsi_connection_class);