Whamcloud - gitweb
LU-1714 lnet: Properly initialize sg_magic value
[fs/lustre-release.git] / libcfs / autoconf / lustre-libcfs.m4
index dfd9c03..389e4de 100644 (file)
@@ -93,6 +93,26 @@ AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
 ])
 ])
 
+# LIBCFS_DIGEST_SETKEY_FLAGS
+# digest_alg.dia_setkey takes 4 args (2.6.18)
+#
+AC_DEFUN([LIBCFS_DIGEST_SETKEY_FLAGS],
+[AC_MSG_CHECKING([if kernel dia_setkey takes 4 args])
+LB_LINUX_TRY_COMPILE([
+       #include <linux/err.h>
+       #include <linux/crypto.h>
+],[
+       struct digest_alg alg;
+
+       alg.dia_setkey(NULL, NULL, 0, NULL);
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_DIGEST_SETKEY_FLAGS, 1, [kernel dia_setkey takes 4 args])
+],[
+       AC_MSG_RESULT([no])
+])
+])
+
 # 2.6.19 API changes
 # kmem_cache_destroy(cachep) return void instead of
 # int
@@ -222,6 +242,7 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+
 # 2.6.20 API change INIT_WORK use 2 args and not
 # store data inside
 AC_DEFUN([LIBCFS_3ARGS_INIT_WORK],
@@ -325,7 +346,24 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
-# 2.6.24 
+# 2.6.24-rc1 sg_init_table
+AC_DEFUN([LIBCFS_SCATTERLIST_INITTABLE],
+[AC_MSG_CHECKING([for sg_init_table])
+LB_LINUX_TRY_COMPILE([
+       #include <asm/types.h>
+       #include <linux/scatterlist.h>
+],[
+       sg_init_table(NULL,0);
+],[
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_SCATTERLIST_INITTABLE, 1,
+                 [scatterlist has sg_init_table])
+],[
+       AC_MSG_RESULT(NO)
+])
+])
+
+# 2.6.24
 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
 [AC_MSG_CHECKING([for network stack has namespaces])
 LB_LINUX_TRY_COMPILE([
@@ -490,6 +528,25 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# LIBCFS_STRUCT_SHASH_ALG
+# struct shash_alg was introduced in 2.6.29
+#
+AC_DEFUN([LIBCFS_STRUCT_SHASH_ALG],
+[AC_MSG_CHECKING([if kernel has struct shash_alg])
+LB_LINUX_TRY_COMPILE([
+       #include <linux/err.h>
+       #include <crypto/internal/hash.h>
+],[
+       struct shash_alg foo;
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_STRUCT_SHASH_ALG, 1, [kernel has struct shash_alg])
+],[
+       AC_MSG_RESULT([no])
+])
+])
+
+
 #
 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
 #
@@ -712,6 +769,7 @@ LIBCFS_U64_LONG_LONG_LINUX
 # 2.6.18
 LIBCFS_TASKLIST_LOCK
 LIBCFS_HAVE_IS_COMPAT_TASK
+LIBCFS_DIGEST_SETKEY_FLAGS
 # 2.6.19
 LIBCFS_KMEM_CACHE_DESTROY_INT
 # 2.6.20
@@ -724,6 +782,7 @@ LC_REGISTER_SHRINKER
 # 2.6.24
 LIBCFS_SYSCTL_UNNUMBERED
 LIBCFS_SCATTERLIST_SETPAGE
+LIBCFS_SCATTERLIST_INITTABLE
 LIBCFS_NETWORK_NAMESPACE
 LIBCFS_FUNC_DUMP_TRACE
 # 2.6.26
@@ -735,6 +794,7 @@ LIBCFS_CPUMASK_SIZE
 # 2.6.29
 LIBCFS_STRUCT_CRED_IN_TASK
 LIBCFS_CPU_TOPOLOGY
+LIBCFS_STRUCT_SHASH_ALG
 # 2.6.30
 LIBCFS_FUNC_UNSHARE_FS_STRUCT
 LIBCFS_SOCK_MAP_FD_2ARG
@@ -793,6 +853,12 @@ AC_CHECK_TYPE([spinlock_t],
 # lnet/utils/wirecheck.c
 AC_CHECK_FUNCS([strnlen])
 
+# lnet/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
+AC_CHECK_FUNCS([strlcpy])
+
+# libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
+AC_CHECK_FUNCS([strlcat])
+
 AC_CHECK_TYPE([umode_t],
        [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
        [],