|
@@ -1630,8 +1630,10 @@ static void clean_writequeues(void)
|
|
|
|
|
|
|
|
static void work_stop(void)
|
|
static void work_stop(void)
|
|
|
{
|
|
{
|
|
|
- destroy_workqueue(recv_workqueue);
|
|
|
|
|
- destroy_workqueue(send_workqueue);
|
|
|
|
|
|
|
+ if (recv_workqueue)
|
|
|
|
|
+ destroy_workqueue(recv_workqueue);
|
|
|
|
|
+ if (send_workqueue)
|
|
|
|
|
+ destroy_workqueue(send_workqueue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int work_start(void)
|
|
static int work_start(void)
|
|
@@ -1691,13 +1693,17 @@ static void work_flush(void)
|
|
|
struct hlist_node *n;
|
|
struct hlist_node *n;
|
|
|
struct connection *con;
|
|
struct connection *con;
|
|
|
|
|
|
|
|
- flush_workqueue(recv_workqueue);
|
|
|
|
|
- flush_workqueue(send_workqueue);
|
|
|
|
|
|
|
+ if (recv_workqueue)
|
|
|
|
|
+ flush_workqueue(recv_workqueue);
|
|
|
|
|
+ if (send_workqueue)
|
|
|
|
|
+ flush_workqueue(send_workqueue);
|
|
|
do {
|
|
do {
|
|
|
ok = 1;
|
|
ok = 1;
|
|
|
foreach_conn(stop_conn);
|
|
foreach_conn(stop_conn);
|
|
|
- flush_workqueue(recv_workqueue);
|
|
|
|
|
- flush_workqueue(send_workqueue);
|
|
|
|
|
|
|
+ if (recv_workqueue)
|
|
|
|
|
+ flush_workqueue(recv_workqueue);
|
|
|
|
|
+ if (send_workqueue)
|
|
|
|
|
+ flush_workqueue(send_workqueue);
|
|
|
for (i = 0; i < CONN_HASH_SIZE && ok; i++) {
|
|
for (i = 0; i < CONN_HASH_SIZE && ok; i++) {
|
|
|
hlist_for_each_entry_safe(con, n,
|
|
hlist_for_each_entry_safe(con, n,
|
|
|
&connection_hash[i], list) {
|
|
&connection_hash[i], list) {
|