summaryrefslogtreecommitdiffstats
path: root/kernel/devices.c
diff options
context:
space:
mode:
authorSebastian Schmelzer2008-04-08 20:04:39 +0200
committerSebastian Schmelzer2008-04-08 20:04:39 +0200
commit8c9150ca2220706abb9f7642fdc26f779800b3b7 (patch)
tree5e92763e576d47ecd9d88e76eda9b58f8d27b7fb /kernel/devices.c
parentImport dnbd* from the former openslx-contrib repo as of revision 92. (diff)
downloaddnbd2-8c9150ca2220706abb9f7642fdc26f779800b3b7.tar.gz
dnbd2-8c9150ca2220706abb9f7642fdc26f779800b3b7.tar.xz
dnbd2-8c9150ca2220706abb9f7642fdc26f779800b3b7.zip
* added kernel version check to module source
* removed branch for old kernels git-svn-id: http://svn.openslx.org/svn/openslx/contrib/dnbd2/trunk@1731 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'kernel/devices.c')
-rw-r--r--kernel/devices.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/devices.c b/kernel/devices.c
index ccc6db1..7c1102b 100644
--- a/kernel/devices.c
+++ b/kernel/devices.c
@@ -106,8 +106,13 @@ int add_device(dnbd2_device_t *dev, int minor)
* Prepare dnbd2_device_t. Please use the
* same order as in dnbd2.h.
*/
- INIT_WORK(&dev->work, NULL); //, NULL);
- /* Change in /<linuxheaders>/include/linux/workqueue.h */
+
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
+ INIT_WORK(&dev->work, NULL, NULL);
+ #else
+ INIT_WORK(&dev->work, NULL);
+ #endif
+
spin_lock_init(&dev->kmap_lock);
for (i=0 ; i<POOL_SIZE ; i++)
dev->info_pool[i].cnt = -1;
@@ -145,7 +150,11 @@ int add_device(dnbd2_device_t *dev, int minor)
init_completion(&srv_info->rx_start);
init_completion(&srv_info->rx_stop);
init_waitqueue_head(&srv_info->wq);
- INIT_WORK(&srv_info->work, NULL); //, NULL);
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
+ INIT_WORK(&srv_info->work, NULL, NULL);
+ #else
+ INIT_WORK(&srv_info->work, NULL);
+ #endif
/* Change in /<linuxheaders>/include/linux/workqueue.h */
srv_info->dev = dev;
}