Whamcloud - gitweb
remove compiler warnings.
authorshadow <shadow>
Fri, 18 Jan 2008 08:01:23 +0000 (08:01 +0000)
committershadow <shadow>
Fri, 18 Jan 2008 08:01:23 +0000 (08:01 +0000)
b=14520
i=nikita
i=johann

build/autoconf/lustre-build-linux.m4
lnet/autoconf/lustre-lnet.m4
lnet/include/libcfs/linux/linux-mem.h
lustre/include/lustre_capa.h

index 9759b49..f26375d 100644 (file)
@@ -343,9 +343,7 @@ AC_DEFUN([LB_LINUX_TRY_COMPILE],
 AC_DEFUN([LB_LINUX_CONFIG],
 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
 LB_LINUX_TRY_COMPILE([
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
+#include <linux/autoconf.h>
 ],[
 #ifndef CONFIG_$1
 #error CONFIG_$1 not #defined
@@ -366,7 +364,9 @@ $3
 #
 AC_DEFUN([LB_LINUX_CONFIG_IM],
 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
-LB_LINUX_TRY_COMPILE([#include <linux/config.h>],[
+LB_LINUX_TRY_COMPILE([
+#include <linux/autoconf.h>
+],[
 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
 #endif
index 8b27da8..5325bc3 100644 (file)
@@ -1131,23 +1131,23 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
-# 2.6.21 uses struct kmem_cache instead of kmem_cache_s for
-# kmem_cache_t
-AC_DEFUN([LN_KMEM_CACHE_S],
-[AC_MSG_CHECKING([check kernel has struct kmem_cache_s])
+# 2.6.21 marks kmem_cache_t deprecated and uses struct kmem_cache
+# instead
+AC_DEFUN([LN_KMEM_CACHE],
+[AC_MSG_CHECKING([check kernel has struct kmem_cache])
 tmp_flags="$EXTRA_KCFLAGS"
 EXTRA_KCFLAGS="-Werror"
 LB_LINUX_TRY_COMPILE([
         #include <linux/slab.h>
+        typedef struct kmem_cache cache_t;
 ],[
-       kmem_cache_s *cachep = NULL;
-       
-       kmem_cache_free(cachep, NULL);
+       cache_t *cachep = NULL;
 
+       kmem_cache_alloc(cachep, 0);
 ],[
         AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_KMEM_CACHE_S, 1,
-                  [kernel has struct kmem_cache_s])
+        AC_DEFINE(HAVE_KMEM_CACHE, 1,
+                  [kernel has struct kmem_cache])
 ],[
         AC_MSG_RESULT(NO)
 ])
@@ -1159,7 +1159,6 @@ AC_DEFUN([LN_KMEM_CACHE_CREATE_DTOR],
 LB_LINUX_TRY_COMPILE([
         #include <linux/slab.h>
 ],[
-        struct kmem_cache_s *cachep = NULL;
        kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
 ],[
         AC_MSG_RESULT(yes)
@@ -1206,7 +1205,7 @@ LN_ATOMIC_PANIC_NOTIFIER
 LN_3ARGS_INIT_WORK
 # 2.6.21
 LN_2ARGS_REGISTER_SYSCTL
-LN_KMEM_CACHE_S
+LN_KMEM_CACHE
 # 2.6.23
 LN_KMEM_CACHE_CREATE_DTOR
 ])
index 4f19edd..fa4ba3d 100644 (file)
@@ -101,10 +101,10 @@ extern void __cfs_free_pages(cfs_page_t *page, unsigned int order);
  * SLAB allocator
  * XXX Liang: move these declare to public file
  */
-#ifdef HAVE_KMEM_CACHE_S
-typedef struct kmem_cache_s cfs_mem_cache_t;
-#else
+#ifdef HAVE_KMEM_CACHE
 typedef struct kmem_cache cfs_mem_cache_t;
+#else
+typedef kmem_cache_t cfs_mem_cache_t;
 #endif
 extern cfs_mem_cache_t * cfs_mem_cache_create (const char *, size_t, size_t, unsigned long);
 extern int cfs_mem_cache_destroy ( cfs_mem_cache_t * );
index add2982..9e71a21 100644 (file)
@@ -165,7 +165,7 @@ static inline struct obd_capa *alloc_capa(int site)
 #ifdef __KERNEL__
         struct obd_capa *ocapa;
 
-        OBD_SLAB_ALLOC(ocapa, capa_cachep, SLAB_KERNEL, sizeof(*ocapa));
+        OBD_SLAB_ALLOC(ocapa, capa_cachep, GFP_KERNEL, sizeof(*ocapa));
         if (ocapa) {
                 atomic_set(&ocapa->c_refc, 0);
                 spin_lock_init(&ocapa->c_lock);