diff options
-rw-r--r-- | net/9p/trans_fd.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 078eb162d9bf..e9f797d24414 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -155,7 +155,6 @@ struct p9_conn { | |||
155 | 155 | ||
156 | static DEFINE_SPINLOCK(p9_poll_lock); | 156 | static DEFINE_SPINLOCK(p9_poll_lock); |
157 | static LIST_HEAD(p9_poll_pending_list); | 157 | static LIST_HEAD(p9_poll_pending_list); |
158 | static struct workqueue_struct *p9_mux_wq; | ||
159 | static struct task_struct *p9_poll_task; | 158 | static struct task_struct *p9_poll_task; |
160 | 159 | ||
161 | static void p9_mux_poll_stop(struct p9_conn *m) | 160 | static void p9_mux_poll_stop(struct p9_conn *m) |
@@ -384,7 +383,7 @@ static void p9_read_work(struct work_struct *work) | |||
384 | 383 | ||
385 | if (n & POLLIN) { | 384 | if (n & POLLIN) { |
386 | P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m); | 385 | P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m); |
387 | queue_work(p9_mux_wq, &m->rq); | 386 | schedule_work(&m->rq); |
388 | } else | 387 | } else |
389 | clear_bit(Rworksched, &m->wsched); | 388 | clear_bit(Rworksched, &m->wsched); |
390 | } else | 389 | } else |
@@ -497,7 +496,7 @@ static void p9_write_work(struct work_struct *work) | |||
497 | 496 | ||
498 | if (n & POLLOUT) { | 497 | if (n & POLLOUT) { |
499 | P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m); | 498 | P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m); |
500 | queue_work(p9_mux_wq, &m->wq); | 499 | schedule_work(&m->wq); |
501 | } else | 500 | } else |
502 | clear_bit(Wworksched, &m->wsched); | 501 | clear_bit(Wworksched, &m->wsched); |
503 | } else | 502 | } else |
@@ -629,7 +628,7 @@ static void p9_poll_mux(struct p9_conn *m) | |||
629 | P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m); | 628 | P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m); |
630 | if (!test_and_set_bit(Rworksched, &m->wsched)) { | 629 | if (!test_and_set_bit(Rworksched, &m->wsched)) { |
631 | P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m); | 630 | P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m); |
632 | queue_work(p9_mux_wq, &m->rq); | 631 | schedule_work(&m->rq); |
633 | } | 632 | } |
634 | } | 633 | } |
635 | 634 | ||
@@ -639,7 +638,7 @@ static void p9_poll_mux(struct p9_conn *m) | |||
639 | if ((m->wsize || !list_empty(&m->unsent_req_list)) && | 638 | if ((m->wsize || !list_empty(&m->unsent_req_list)) && |
640 | !test_and_set_bit(Wworksched, &m->wsched)) { | 639 | !test_and_set_bit(Wworksched, &m->wsched)) { |
641 | P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m); | 640 | P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m); |
642 | queue_work(p9_mux_wq, &m->wq); | 641 | schedule_work(&m->wq); |
643 | } | 642 | } |
644 | } | 643 | } |
645 | } | 644 | } |
@@ -677,7 +676,7 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req) | |||
677 | n = p9_fd_poll(m->client, NULL); | 676 | n = p9_fd_poll(m->client, NULL); |
678 | 677 | ||
679 | if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched)) | 678 | if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched)) |
680 | queue_work(p9_mux_wq, &m->wq); | 679 | schedule_work(&m->wq); |
681 | 680 | ||
682 | return 0; | 681 | return 0; |
683 | } | 682 | } |
@@ -1083,15 +1082,8 @@ static int p9_poll_proc(void *a) | |||
1083 | 1082 | ||
1084 | int p9_trans_fd_init(void) | 1083 | int p9_trans_fd_init(void) |
1085 | { | 1084 | { |
1086 | p9_mux_wq = create_workqueue("v9fs"); | ||
1087 | if (!p9_mux_wq) { | ||
1088 | printk(KERN_WARNING "v9fs: mux: creating workqueue failed\n"); | ||
1089 | return -ENOMEM; | ||
1090 | } | ||
1091 | |||
1092 | p9_poll_task = kthread_run(p9_poll_proc, NULL, "v9fs-poll"); | 1085 | p9_poll_task = kthread_run(p9_poll_proc, NULL, "v9fs-poll"); |
1093 | if (IS_ERR(p9_poll_task)) { | 1086 | if (IS_ERR(p9_poll_task)) { |
1094 | destroy_workqueue(p9_mux_wq); | ||
1095 | printk(KERN_WARNING "v9fs: mux: creating poll task failed\n"); | 1087 | printk(KERN_WARNING "v9fs: mux: creating poll task failed\n"); |
1096 | return PTR_ERR(p9_poll_task); | 1088 | return PTR_ERR(p9_poll_task); |
1097 | } | 1089 | } |
@@ -1109,6 +1101,4 @@ void p9_trans_fd_exit(void) | |||
1109 | v9fs_unregister_trans(&p9_tcp_trans); | 1101 | v9fs_unregister_trans(&p9_tcp_trans); |
1110 | v9fs_unregister_trans(&p9_unix_trans); | 1102 | v9fs_unregister_trans(&p9_unix_trans); |
1111 | v9fs_unregister_trans(&p9_fd_trans); | 1103 | v9fs_unregister_trans(&p9_fd_trans); |
1112 | |||
1113 | destroy_workqueue(p9_mux_wq); | ||
1114 | } | 1104 | } |