From: shadow Date: Fri, 18 Apr 2008 09:45:32 +0000 (+0000) Subject: Fix warnings with compile liblustre at sles10/rhel5 which have X-Git-Tag: v1_7_0_51~32 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9f8231e8190b9a849abd2c6198c340c9b7397803;hp=e59595df1694838b8f32527e0e6806b4730f78d1 Fix warnings with compile liblustre at sles10/rhel5 which have __u64 as usingied long long type. b=15517 i=johan i=deen --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index c7f7160..c016f84 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -1056,6 +1056,29 @@ AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported]) ]) ]) +# check userland __u64 type +AC_DEFUN([LN_U64_LONG_LONG], +[AC_MSG_CHECKING([check u64 is long long type]) +tmp_flags="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([ + #include + int main(void) { + unsigned long long *data1; + __u64 *data2; + + data1 = data2; + return 0; + } +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_U64_LONG_LONG, 1, + [__u64 is long long type]) +],[ +]) +CFLAGS="$tmp_flags" +]) + # LN_TASKLIST_LOCK # 2.6.18 remove tasklist_lock export AC_DEFUN([LN_TASKLIST_LOCK], @@ -1205,6 +1228,7 @@ LN_CONFIG_MX LN_STRUCT_PAGE_LIST LN_STRUCT_SIGHAND LN_FUNC_SHOW_TASK +LN_U64_LONG_LONG # 2.6.18 LN_TASKLIST_LOCK # 2.6.19 diff --git a/lnet/include/libcfs/linux/kp30.h b/lnet/include/libcfs/linux/kp30.h index aceaa2c..7de45d6 100644 --- a/lnet/include/libcfs/linux/kp30.h +++ b/lnet/include/libcfs/linux/kp30.h @@ -340,7 +340,7 @@ extern int lwt_snapshot (cycles_t *now, int *ncpu, int *total_size, #define _LWORDSIZE __WORDSIZE #endif -#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3))) +#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3))) || defined(HAVE_U64_LONG_LONG) /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ # define LPU64 "%Lu" # define LPD64 "%Ld"