summaryrefslogtreecommitdiffstats
path: root/kernel/servers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/servers.c')
-rw-r--r--kernel/servers.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/servers.c b/kernel/servers.c
index bd7f386..e79bf91 100644
--- a/kernel/servers.c
+++ b/kernel/servers.c
@@ -146,12 +146,12 @@ void activate_fastest_work(struct work_struct *work)
int start_rx_loop(struct srv_info *srv_info)
{
- srv_info->rx_id = kernel_thread(dnbd2_rx_loop, srv_info, CLONE_KERNEL);
- if (srv_info->rx_id < 0) {
+ srv_info->dnbd_thread_task = kthread_run(dnbd2_rx_loop, srv_info, "DNBD2");
+ if (IS_ERR(srv_info->dnbd_thread_task)){
srv_info->rx_id = 0;
return -1;
}
- wait_for_completion(&srv_info->rx_start);
+ //wait_for_completion(&srv_info->rx_start);
return 0;
}
@@ -161,11 +161,12 @@ void stop_rx_loop(struct srv_info *srv_info)
if (!srv_info->rx_id)
return;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- kill_proc_info(SIGKILL, 1, srv_info->rx_id);
+ //kill_proc_info(SIGKILL, 1, srv_info->rx_id);
+ kthread_stop(srv_info->dnbd_thread_task);
#else
kill_proc(srv_info->rx_id, SIGKILL, 1);
#endif
- wait_for_completion(&srv_info->rx_stop);
+ //wait_for_completion(&srv_info->rx_stop);
srv_info->rx_id = 0;
}
@@ -274,7 +275,7 @@ sector_t srv_get_capacity(struct srv_info *srv_info)
info->dst = srv_info;
info->last_dst = srv_info;
req->special = info;
- req->sector = 0;
+ req->__sector = 0;
INIT_LIST_HEAD(&req->queuelist);
/* Enqueue the request for sending. */
@@ -349,7 +350,7 @@ void enqueue_hb(struct srv_info *srv_info)
info->dst = srv_info;
info->last_dst = srv_info;
req->special = info;
- req->sector = 0;
+ req->__sector = 0;
INIT_LIST_HEAD(&req->queuelist);
/* Enqueue the request for sending. */