From 36cf3a03b229eef31bcb53e7b9b09f829010f8dc Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 20 Aug 2010 10:24:13 +0200 Subject: working with current kernel, ifdef switch for other kernel versions needs to be implemented --- kernel/servers.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'kernel/servers.c') 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. */ -- cgit v1.2.3-55-g7522