@@ -27,6 +27,8 @@ static DEFINE_IDA(cntlid_ida);
2727
2828struct workqueue_struct * nvmet_wq ;
2929EXPORT_SYMBOL_GPL (nvmet_wq );
30+ struct workqueue_struct * nvmet_aen_wq ;
31+ EXPORT_SYMBOL_GPL (nvmet_aen_wq );
3032
3133/*
3234 * This read/write semaphore is used to synchronize access to configuration
@@ -206,7 +208,7 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type,
206208 list_add_tail (& aen -> entry , & ctrl -> async_events );
207209 mutex_unlock (& ctrl -> lock );
208210
209- queue_work (nvmet_wq , & ctrl -> async_event_work );
211+ queue_work (nvmet_aen_wq , & ctrl -> async_event_work );
210212}
211213
212214static void nvmet_add_to_changed_ns_log (struct nvmet_ctrl * ctrl , __le32 nsid )
@@ -1959,9 +1961,14 @@ static int __init nvmet_init(void)
19591961 if (!nvmet_wq )
19601962 goto out_free_buffered_work_queue ;
19611963
1964+ nvmet_aen_wq = alloc_workqueue ("nvmet-aen-wq" ,
1965+ WQ_MEM_RECLAIM | WQ_UNBOUND , 0 );
1966+ if (!nvmet_aen_wq )
1967+ goto out_free_nvmet_work_queue ;
1968+
19621969 error = nvmet_init_debugfs ();
19631970 if (error )
1964- goto out_free_nvmet_work_queue ;
1971+ goto out_free_nvmet_aen_work_queue ;
19651972
19661973 error = nvmet_init_discovery ();
19671974 if (error )
@@ -1977,6 +1984,8 @@ static int __init nvmet_init(void)
19771984 nvmet_exit_discovery ();
19781985out_exit_debugfs :
19791986 nvmet_exit_debugfs ();
1987+ out_free_nvmet_aen_work_queue :
1988+ destroy_workqueue (nvmet_aen_wq );
19801989out_free_nvmet_work_queue :
19811990 destroy_workqueue (nvmet_wq );
19821991out_free_buffered_work_queue :
@@ -1994,6 +2003,7 @@ static void __exit nvmet_exit(void)
19942003 nvmet_exit_discovery ();
19952004 nvmet_exit_debugfs ();
19962005 ida_destroy (& cntlid_ida );
2006+ destroy_workqueue (nvmet_aen_wq );
19972007 destroy_workqueue (nvmet_wq );
19982008 destroy_workqueue (buffered_io_wq );
19992009 destroy_workqueue (zbd_wq );
0 commit comments