From 288a89d1319dfa91fde56f60ad48f8116e34bbe7 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Tue, 25 Aug 2009 15:21:10 +0000 Subject: * 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 --- kernel/dnbd2.h | 4 ++++ 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 #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +#include +#else #include +#endif #include #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; -- cgit v1.2.3-55-g7522