diff options
author | Bastian Wissler | 2009-08-25 17:21:10 +0200 |
---|---|---|
committer | Bastian Wissler | 2009-08-25 17:21:10 +0200 |
commit | 288a89d1319dfa91fde56f60ad48f8116e34bbe7 (patch) | |
tree | efb75286abcbe4de27ecd6c014963d067b27ad92 | |
parent | Not really a fix yet, but "kill_proc" is deprecated in newer kernels ... (diff) | |
download | dnbd2-288a89d1319dfa91fde56f60ad48f8116e34bbe7.tar.gz dnbd2-288a89d1319dfa91fde56f60ad48f8116e34bbe7.tar.xz dnbd2-288a89d1319dfa91fde56f60ad48f8116e34bbe7.zip |
* fixed dnbd2 for newer kernel versions (compiled with 2.6.28-11-generic ubuntu kernel)
WARNING: "kill_proc_info" [.../kernel/dnbd2.ko] undefined!
-> this warning is critical, as the symbol has been unexported after 2.6.10-rc3 or so.
git-svn-id: http://svn.openslx.org/svn/openslx/contrib/dnbd2/trunk@3132 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r-- | kernel/dnbd2.h | 4 | ||||
-rw-r--r-- | kernel/sysfs.c | 19 |
2 files changed, 18 insertions, 5 deletions
diff --git a/kernel/dnbd2.h b/kernel/dnbd2.h index c49c9b9..2bf0f76 100644 --- a/kernel/dnbd2.h +++ b/kernel/dnbd2.h @@ -12,7 +12,11 @@ #include <linux/inet.h> #include <linux/in.h> #include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +#include <linux/semaphore.h> +#else #include <asm/semaphore.h> +#endif #include <net/sock.h> #include "../include/dnbd2.h" diff --git a/kernel/sysfs.c b/kernel/sysfs.c index 2ed8174..d23fbed 100644 --- a/kernel/sysfs.c +++ b/kernel/sysfs.c @@ -440,14 +440,23 @@ int start_sysfs(dnbd2_device_t *dev) int i; char name[] = "server99"; - if (setup_kobj(&dev->kobj, "config", &dev->disk->dev.kobj, &device_ktype)) - return -1; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) + if (setup_kobj(&dev->kobj, "config", get_disk(dev->disk), &device_ktype)) +#else + if (setup_kobj(&dev->kobj, "config", &dev->disk->dev.kobj, &device_ktype)) +#endif + return -1; for_each_server(i) { sprintf(name, "server%d", i); - if (setup_kobj(&dev->servers[i].kobj, name, - &dev->disk->dev.kobj, &server_ktype)) - goto out; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) + if (setup_kobj(&dev->servers[i].kobj, name, + get_disk(dev->disk), &server_ktype)) +#else + if(setup_kobj(&dev-servers[i].kobj, name, + &dev->disk->dev.kobj, &server_ktype)) +#endif + goto out; } return 0; |