[DRBD-cvs] svn commit by phil - r2822 - in trunk: drbd drbd/linux
scripts - Make DRBD to work on SLES9 again (and probably other ol
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Mon Apr 2 18:02:59 CEST 2007
Author: phil
Date: 2007-04-02 18:02:58 +0200 (Mon, 02 Apr 2007)
New Revision: 2822
Modified:
trunk/drbd/drbd_compat_wrappers.h
trunk/drbd/linux/drbd_config.h
trunk/scripts/adjust_drbd_config_h.sh
Log:
Make DRBD to work on SLES9 again (and probably other
older Linux-2.6.x based distron)
Modified: trunk/drbd/drbd_compat_wrappers.h
===================================================================
--- trunk/drbd/drbd_compat_wrappers.h 2007-03-27 14:35:01 UTC (rev 2821)
+++ trunk/drbd/drbd_compat_wrappers.h 2007-04-02 16:02:58 UTC (rev 2822)
@@ -329,7 +329,7 @@
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+#ifdef NEED_BACKPORT_OF_KZALLOC
static inline void *kzalloc(size_t size, int flags)
{
void *rv = kmalloc(size,flags);
Modified: trunk/drbd/linux/drbd_config.h
===================================================================
--- trunk/drbd/linux/drbd_config.h 2007-03-27 14:35:01 UTC (rev 2821)
+++ trunk/drbd/linux/drbd_config.h 2007-04-02 16:02:58 UTC (rev 2822)
@@ -73,4 +73,7 @@
// member called dst_groups. Later it is called dst_group (without 's').
//#define DRBD_NL_DST_GROUPS
+// in older kernels (vanilla < 2.6.14) is no kzalloc()
+//#define NEED_BACKPORT_OF_KZALLOC
+
#endif
Modified: trunk/scripts/adjust_drbd_config_h.sh
===================================================================
--- trunk/scripts/adjust_drbd_config_h.sh 2007-03-27 14:35:01 UTC (rev 2821)
+++ trunk/scripts/adjust_drbd_config_h.sh 2007-04-02 16:02:58 UTC (rev 2822)
@@ -85,6 +85,11 @@
else
have_nl_dst_groups=0
fi
+ if grep_q "kzalloc" $KDIR/include/linux/slab.h ; then
+ need_backport_of_kzalloc=0
+ else
+ need_backport_of_kzalloc=1
+ fi
else
# not a 2.6. kernel. just leave it alone...
exit 0
@@ -106,6 +111,8 @@
{ ( $have_sock_create_kern ? '//' : '' ) . \$1}e;
s{.*(#define DRBD_NL_DST_GROUPS.*)}
{ ( $have_nl_dst_groups ? '' : '//' ) . \$1}e;
+ s{.*(#define NEED_BACKPORT_OF_KZALLOC.*)}
+ { ( $need_backport_of_kzalloc ? '' : '//' ) . \$1}e;
" \
< ./linux/drbd_config.h \
> ./linux/drbd_config.h.new
More information about the drbd-cvs
mailing list