diff options
author | Johann Latocha | 2011-06-30 02:44:51 +0200 |
---|---|---|
committer | Johann Latocha | 2011-06-30 02:44:51 +0200 |
commit | 4d88c9cb065439f31bf2c5c28ab1c729f4196522 (patch) | |
tree | 4e8068c696b33233d38db40ca8e0d048cdde0163 /kernel | |
parent | Working with kernel 2.6.36 (diff) | |
download | dnbd2-master.tar.gz dnbd2-master.tar.xz dnbd2-master.zip |
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/devices.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/devices.c b/kernel/devices.c index 857a106..a9e7249 100644 --- a/kernel/devices.c +++ b/kernel/devices.c @@ -129,7 +129,11 @@ int add_device(dnbd2_device_t *dev, int minor) dev->rid = 0; atomic_set(&dev->refcnt, 0); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + sema_init(&dev->config_mutex, 1); +#else init_MUTEX(&dev->config_mutex); +#endif spin_lock_init(&dev->blk_lock); @@ -146,7 +150,11 @@ int add_device(dnbd2_device_t *dev, int minor) init_completion(&dev->tx_start); init_completion(&dev->tx_stop); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + sema_init(&dev->servers_mutex, 1); +#else init_MUTEX(&dev->servers_mutex); +#endif for_each_server(i) { dev->emerg_list[i].ip = 0; dev->emerg_list[i].port = 0; |