From: shadow Date: Fri, 18 Jan 2008 08:01:23 +0000 (+0000) Subject: remove compiler warnings. X-Git-Tag: v1_7_0_51~305 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=99293c489dc2330bbb8ce3734f575003d4812811 remove compiler warnings. b=14520 i=nikita i=johann --- diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index 9759b49..f26375d 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -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 -#endif +#include ],[ #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 ],[ +LB_LINUX_TRY_COMPILE([ +#include +],[ #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE)) #error CONFIG_$1 and CONFIG_$1_MODULE not #defined #endif diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 8b27da8..5325bc3 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -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 + 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 ],[ - 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 ]) diff --git a/lnet/include/libcfs/linux/linux-mem.h b/lnet/include/libcfs/linux/linux-mem.h index 4f19edd..fa4ba3d 100644 --- a/lnet/include/libcfs/linux/linux-mem.h +++ b/lnet/include/libcfs/linux/linux-mem.h @@ -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 * ); diff --git a/lustre/include/lustre_capa.h b/lustre/include/lustre_capa.h index add2982..9e71a21 100644 --- a/lustre/include/lustre_capa.h +++ b/lustre/include/lustre_capa.h @@ -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);