[rds-commits] zab commits r98 - in trunk: . kapi-compat linux/net/rds

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Mon Jun 5 15:31:59 CDT 2006


Author: zab
Date: 2006-06-05 15:31:58 -0500 (Mon, 05 Jun 2006)
New Revision: 98

Added:
   trunk/kapi-compat/gfp_t.h
   trunk/kapi-compat/kzalloc.h
Modified:
   trunk/configure.in
   trunk/linux/net/rds/stats.c
Log:
Fix the build under an older RHEL4 kernel.

Add compat for gfp_t and kzalloc().

Include a default case to appease gcc.  It's probably best to not rely so
heavily on the caller being updated, too.


Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2006-06-02 00:39:24 UTC (rev 97)
+++ trunk/configure.in	2006-06-05 20:31:58 UTC (rev 98)
@@ -103,6 +103,8 @@
 # this is odd, some have it it net/inet_sock.h?
 KERNEL_COMPAT_HEADER(inet_ehashfn, net/inet_hashtables.h)
 KERNEL_COMPAT_HEADER(setup_timer, linux/timer.h)
+KERNEL_COMPAT_HEADER(gfp_t, linux/types.h)
+KERNEL_COMPAT_HEADER(kzalloc, linux/slab.h)
 
 GREP_KERNEL_INCLUDE([PR_RDS in linux/socket.h], linux/socket.h,
 	have_pf_rds=yes, , [PF_RDS])

Added: trunk/kapi-compat/gfp_t.h
===================================================================
--- trunk/kapi-compat/gfp_t.h	2006-06-02 00:39:24 UTC (rev 97)
+++ trunk/kapi-compat/gfp_t.h	2006-06-05 20:31:58 UTC (rev 98)
@@ -0,0 +1 @@
+typedef unsigned gfp_t; 

Added: trunk/kapi-compat/kzalloc.h
===================================================================
--- trunk/kapi-compat/kzalloc.h	2006-06-02 00:39:24 UTC (rev 97)
+++ trunk/kapi-compat/kzalloc.h	2006-06-05 20:31:58 UTC (rev 98)
@@ -0,0 +1,7 @@
+static inline void *kzalloc(size_t size, gfp_t flags)
+{
+	void *ret = kmalloc(size, flags);
+	if (ret)
+		memset(ret, 0, size);
+	return ret;
+}

Modified: trunk/linux/net/rds/stats.c
===================================================================
--- trunk/linux/net/rds/stats.c	2006-06-02 00:39:24 UTC (rev 97)
+++ trunk/linux/net/rds/stats.c	2006-06-05 20:31:58 UTC (rev 98)
@@ -62,6 +62,9 @@
 			elements = sizeof(struct rds_statistics) /
 				   sizeof(unsigned long);
 			break;
+		default:
+			ret = -EINVAL;
+			goto out;
 	}
 
 	cur = 0;




More information about the rds-commits mailing list