@@ -42,6 +42,7 @@ MODULE_PARM_DESC(sg_tablesize,
42
42
43
43
static DEFINE_MUTEX (device_list_mutex );
44
44
static LIST_HEAD (device_list );
45
+ static struct workqueue_struct * isert_login_wq ;
45
46
static struct workqueue_struct * isert_comp_wq ;
46
47
static struct workqueue_struct * isert_release_wq ;
47
48
@@ -1017,7 +1018,7 @@ isert_rx_login_req(struct isert_conn *isert_conn)
1017
1018
complete (& isert_conn -> login_comp );
1018
1019
return ;
1019
1020
}
1020
- schedule_delayed_work ( & conn -> login_work , 0 );
1021
+ queue_delayed_work ( isert_login_wq , & conn -> login_work , 0 );
1021
1022
}
1022
1023
1023
1024
static struct iscsi_cmd
@@ -2348,9 +2349,9 @@ isert_get_login_rx(struct iscsi_conn *conn, struct iscsi_login *login)
2348
2349
2349
2350
/*
2350
2351
* For login requests after the first PDU, isert_rx_login_req() will
2351
- * kick schedule_delayed_work( &conn->login_work) as the packet is
2352
- * received, which turns this callback from iscsi_target_do_login_rx()
2353
- * into a NOP.
2352
+ * kick queue_delayed_work(isert_login_wq, &conn->login_work) as
2353
+ * the packet is received, which turns this callback from
2354
+ * iscsi_target_do_login_rx() into a NOP.
2354
2355
*/
2355
2356
if (!login -> first_request )
2356
2357
return 0 ;
@@ -2606,20 +2607,23 @@ static struct iscsit_transport iser_target_transport = {
2606
2607
2607
2608
static int __init isert_init (void )
2608
2609
{
2609
- int ret ;
2610
+ isert_login_wq = alloc_workqueue ("isert_login_wq" , 0 , 0 );
2611
+ if (!isert_login_wq ) {
2612
+ isert_err ("Unable to allocate isert_login_wq\n" );
2613
+ return - ENOMEM ;
2614
+ }
2610
2615
2611
2616
isert_comp_wq = alloc_workqueue ("isert_comp_wq" ,
2612
2617
WQ_UNBOUND | WQ_HIGHPRI , 0 );
2613
2618
if (!isert_comp_wq ) {
2614
2619
isert_err ("Unable to allocate isert_comp_wq\n" );
2615
- return - ENOMEM ;
2620
+ goto destroy_login_wq ;
2616
2621
}
2617
2622
2618
2623
isert_release_wq = alloc_workqueue ("isert_release_wq" , WQ_UNBOUND ,
2619
2624
WQ_UNBOUND_MAX_ACTIVE );
2620
2625
if (!isert_release_wq ) {
2621
2626
isert_err ("Unable to allocate isert_release_wq\n" );
2622
- ret = - ENOMEM ;
2623
2627
goto destroy_comp_wq ;
2624
2628
}
2625
2629
@@ -2630,17 +2634,20 @@ static int __init isert_init(void)
2630
2634
2631
2635
destroy_comp_wq :
2632
2636
destroy_workqueue (isert_comp_wq );
2637
+ destroy_login_wq :
2638
+ destroy_workqueue (isert_login_wq );
2633
2639
2634
- return ret ;
2640
+ return - ENOMEM ;
2635
2641
}
2636
2642
2637
2643
static void __exit isert_exit (void )
2638
2644
{
2639
- flush_scheduled_work ( );
2645
+ flush_workqueue ( isert_login_wq );
2640
2646
destroy_workqueue (isert_release_wq );
2641
2647
destroy_workqueue (isert_comp_wq );
2642
2648
iscsit_unregister_transport (& iser_target_transport );
2643
2649
isert_info ("iSER_TARGET[0] - Released iser_target_transport\n" );
2650
+ destroy_workqueue (isert_login_wq );
2644
2651
}
2645
2652
2646
2653
MODULE_DESCRIPTION ("iSER-Target for mainline target infrastructure" );
0 commit comments